X-Git-Url: http://git.jankratochvil.net/?a=blobdiff_plain;f=apps%2Ftests%2Fwm_paint%2Fwm_paint.c;h=734784894b2270471c7549b30a43fc384f0cd853;hb=a3df8bf1429570e0bd6c6428f6ed80073578cf4b;hp=d0d035da70e2328bccfea5a706315c63b0d9ed78;hpb=7c0db166f81fbe8c8b913d7f26048e337d383605;p=reactos.git diff --git a/apps/tests/wm_paint/wm_paint.c b/apps/tests/wm_paint/wm_paint.c index d0d035d..7347848 100644 --- a/apps/tests/wm_paint/wm_paint.c +++ b/apps/tests/wm_paint/wm_paint.c @@ -24,6 +24,7 @@ LRESULT CALLBACK MainWndProc(HWND HWnd, UINT Msg, WPARAM WParam, int APIENTRY WinMain(HINSTANCE HInstance, HINSTANCE HPrevInstance, LPTSTR lpCmdLine, int nCmdShow) { + MSG msg; WNDCLASS wc; memset(&wc, 0, sizeof(WNDCLASS)); @@ -47,7 +48,6 @@ int APIENTRY WinMain(HINSTANCE HInstance, HINSTANCE HPrevInstance, ShowWindow(HWnd, nCmdShow); UpdateWindow(HWnd); - MSG msg; while (GetMessage(&msg, NULL, 0, 0)) { TranslateMessage(&msg); @@ -63,17 +63,20 @@ int APIENTRY WinMain(HINSTANCE HInstance, HINSTANCE HPrevInstance, LRESULT CALLBACK MainWndProc(HWND HWnd, UINT Msg, WPARAM WParam, LPARAM LParam) { + const char* text = "Persistent Text"; + switch (Msg) { case WM_PAINT: { // determine the invalidated area of the window - RECT RUpdate; + RECT RUpdate; + HDC Hdc; GetUpdateRect(HWnd, &RUpdate, NULL); // grab a handle to our window's // common display device context - HDC Hdc = GetDC(HWnd); + Hdc = GetDC(HWnd); #if 0 try #endif @@ -93,7 +96,6 @@ LRESULT CALLBACK MainWndProc(HWND HWnd, UINT Msg, WPARAM WParam, FillRect(Hdc, &RClient, NULL); // render the persistent text - const char* text = "Persistent Text"; SetTextColor(Hdc, PALETTERGB(0, 0, 255)); DrawText(Hdc, text, strlen(text), &RClient, DT_CENTER | DT_VCENTER | DT_SINGLELINE);