WM_PAINT(wParam) might be a valid HDC

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

Changelog:
    Dmitry Timoshkov <dmitry@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;
 





[Index of Archives]     [Gimp for Windows]     [Red Hat]     [Samba]     [Yosemite Camping]     [Graphics Cards]     [Wine Home]

  Powered by Linux