WM_PAINT(wParam) might be a valid HDC.

This commit is contained in:
Dmitry Timoshkov 2003-08-11 18:43:07 +00:00 committed by Alexandre Julliard
parent 4d1d5fd353
commit 03ca764005
2 changed files with 10 additions and 6 deletions

View File

@ -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;

View File

@ -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;