WM_PAINT(wParam) might be a valid HDC

Dmitry Timoshkov dmitry at baikal.ru
Sat Aug 2 09:50:44 CDT 2003


Hello,

Changelog:
    Dmitry Timoshkov <dmitry at codeweavers.com>
    WM_PAINT(wParam) might be a valid HDC.

diff -u  cvs/hq/wine/controls/scroll.c wine/controls/scroll.c
--- cvs/hq/wine/controls/scroll.c	Tue Mar 25 15:17:23 2003
+++ wine/controls/scroll.c	Sat Aug  2 21:11:27 2003
@@ -1428,12 +1428,16 @@ static LRESULT WINAPI ScrollBarWndProc( 
     case WM_PAINT:
         {
             PAINTSTRUCT ps;
-            HDC hdc = BeginPaint( hwnd, &ps );
+            HDC hdc = wParam ? (HDC)wParam : BeginPaint(hwnd, &ps);
             if (GetWindowLongW( hwnd, GWL_STYLE ) & SBS_SIZEBOX)
-                FillRect( hdc, &ps.rcPaint, GetSysColorBrush(COLOR_SCROLLBAR) );
+            {
+                RECT rc;
+                GetClientRect( hwnd, &rc );
+                FillRect( hdc, &rc, GetSysColorBrush(COLOR_SCROLLBAR) );
+            }
             else
                 SCROLL_DrawScrollBar( hwnd, hdc, SB_CTL, TRUE, TRUE );
-            EndPaint( hwnd, &ps );
+            if (!wParam) EndPaint(hwnd, &ps);
         }
         break;
 
diff -u  cvs/hq/wine/controls/static.c wine/controls/static.c
--- cvs/hq/wine/controls/static.c	Tue May 13 09:33:13 2003
+++ wine/controls/static.c	Sat Aug  2 21:11:27 2003
@@ -252,10 +252,10 @@ static LRESULT StaticWndProc_common( HWN
     case WM_PAINT:
         {
             PAINTSTRUCT ps;
-            BeginPaint(hwnd, &ps);
+            HDC hdc = wParam ? (HDC)wParam : BeginPaint(hwnd, &ps);
             if (staticPaintFunc[style])
-                (staticPaintFunc[style])( hwnd, ps.hdc, full_style );
-            EndPaint(hwnd, &ps);
+                (staticPaintFunc[style])( hwnd, hdc, full_style );
+            if (!wParam) EndPaint(hwnd, &ps);
         }
         break;
 






More information about the wine-patches mailing list