/******************************************************************************
* PROPSHEET_Paint
*/
-static LRESULT PROPSHEET_Paint(HWND hwnd)
+static LRESULT PROPSHEET_Paint(HWND hwnd, HDC hdcParam)
{
PropSheetInfo* psInfo = (PropSheetInfo*) GetPropW(hwnd, PropSheetInfoStr);
PAINTSTRUCT ps;
WCHAR szBuffer[256];
int nLength;
- hdc = BeginPaint(hwnd, &ps);
+ hdc = hdcParam ? hdcParam : BeginPaint(hwnd, &ps);
if (!hdc) return 1;
hdcSrc = CreateCompatibleDC(0);
DeleteDC(hdcSrc);
- EndPaint(hwnd, &ps);
+ if (!hdcParam) EndPaint(hwnd, &ps);
return 0;
}
}
case WM_PAINT:
- PROPSHEET_Paint(hwnd);
+ PROPSHEET_Paint(hwnd, (HDC)wParam);
return TRUE;
case WM_DESTROY:
* 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;
}
switch(message) {
case WM_PAINT:
- return SYSLINK_Paint (infoPtr);
+ return SYSLINK_Paint (infoPtr, (HDC)wParam);
case WM_SETCURSOR:
{