Handle wParam in WM_PAINT properly: if non-null, it is the hdc we are
authorDimitrie O. Paun <dpaun@rogers.com>
Fri, 25 Mar 2005 10:26:10 +0000 (10:26 +0000)
committerAlexandre Julliard <julliard@winehq.org>
Fri, 25 Mar 2005 10:26:10 +0000 (10:26 +0000)
supposed to use to draw into.

dlls/comctl32/propsheet.c
dlls/comctl32/syslink.c

index 87a94f9daf2b1c6066feb2a3b0a3f3ff8d631eaf..fc3ed07be8591ab6ebb2a182af2cb62204dc5072 100644 (file)
@@ -3077,7 +3077,7 @@ static BOOL PROPSHEET_DoCommand(HWND hwnd, WORD wID)
 /******************************************************************************
  *            PROPSHEET_Paint
  */
-static LRESULT PROPSHEET_Paint(HWND hwnd)
+static LRESULT PROPSHEET_Paint(HWND hwnd, HDC hdcParam)
 {
     PropSheetInfo* psInfo = (PropSheetInfo*) GetPropW(hwnd, PropSheetInfoStr);
     PAINTSTRUCT ps;
@@ -3092,7 +3092,7 @@ static LRESULT PROPSHEET_Paint(HWND hwnd)
     WCHAR szBuffer[256];
     int nLength;
 
-    hdc = BeginPaint(hwnd, &ps);
+    hdc = hdcParam ? hdcParam : BeginPaint(hwnd, &ps);
     if (!hdc) return 1;
 
     hdcSrc = CreateCompatibleDC(0);
@@ -3266,7 +3266,7 @@ static LRESULT PROPSHEET_Paint(HWND hwnd)
 
     DeleteDC(hdcSrc);
 
-    EndPaint(hwnd, &ps);
+    if (!hdcParam) EndPaint(hwnd, &ps);
 
     return 0;
 }
@@ -3396,7 +3396,7 @@ PROPSHEET_DialogProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
     }
 
     case WM_PAINT:
-      PROPSHEET_Paint(hwnd);
+      PROPSHEET_Paint(hwnd, (HDC)wParam);
       return TRUE;
 
     case WM_DESTROY:
index 5f359d8aed385c806cb20729bc6c8c24da11bc60..703d940011a3af8a5d1b769b8500c16fd618cecd 100644 (file)
@@ -879,13 +879,14 @@ static LRESULT SYSLINK_Draw (SYSLINK_INFO *infoPtr, HDC hdc)
  * SYSLINK_Paint
  * Handles the WM_PAINT message.
  */
-static LRESULT SYSLINK_Paint (SYSLINK_INFO *infoPtr)
+static LRESULT SYSLINK_Paint (SYSLINK_INFO *infoPtr, HDC hdcParam)
 {
     HDC hdc;
     PAINTSTRUCT ps;
-    hdc = BeginPaint (infoPtr->Self, &ps);
+
+    hdc = hdcParam ? hdcParam : BeginPaint (infoPtr->Self, &ps);
     SYSLINK_Draw (infoPtr, hdc);
-    EndPaint (infoPtr->Self, &ps);
+    if (!hdcParam) EndPaint (infoPtr->Self, &ps);
     return 0;
 }
 
@@ -1466,7 +1467,7 @@ static LRESULT WINAPI SysLinkWindowProc(HWND hwnd, UINT message,
 
     switch(message) {
     case WM_PAINT:
-        return SYSLINK_Paint (infoPtr);
+        return SYSLINK_Paint (infoPtr, (HDC)wParam);
 
     case WM_SETCURSOR:
     {