1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
|
WinMain()
{
} // Not going to type out the details of this
LRESULT CALLBACK WndProc(HWND hWnd, UINT msg, WPARAM, wParam, LPARAM lParam)
{
static HWND hStatic;
switch(msg)
{
case WM_CREATE:
{
hStatic = CreateWindow("static", "Some Text", WS_CHILD|WS_VISIBLE, 10, 10, 110, 110, hWnd, NULL, GetModuleHandle(0), NULL);
break;
}
case WM_CHAR:
{
if(wParam = 'g')
SendMessage(hStatic, WM_SETTEXT, 0, (LPARAM)"This is your new text");
break;
}
default:
{
return DefWindowProc(hWnd, msg, wParam, lParam);
}
}
return 0;
}
| |