Commit 03ca7640 authored by Dmitry Timoshkov's avatar Dmitry Timoshkov Committed by Alexandre Julliard

WM_PAINT(wParam) might be a valid HDC.

parent 4d1d5fd3
......@@ -1428,12 +1428,16 @@ static LRESULT WINAPI ScrollBarWndProc( HWND hwnd, UINT message, WPARAM wParam,
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;
......
......@@ -252,10 +252,10 @@ static LRESULT StaticWndProc_common( HWND hwnd, UINT uMsg, WPARAM wParam,
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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment