WM_PAINT(wParam) might be a valid HDC.
This commit is contained in:
parent
4d1d5fd353
commit
03ca764005
|
@ -1428,12 +1428,16 @@ static LRESULT WINAPI ScrollBarWndProc( HWND hwnd, UINT message, WPARAM wParam,
|
||||||
case WM_PAINT:
|
case WM_PAINT:
|
||||||
{
|
{
|
||||||
PAINTSTRUCT ps;
|
PAINTSTRUCT ps;
|
||||||
HDC hdc = BeginPaint( hwnd, &ps );
|
HDC hdc = wParam ? (HDC)wParam : BeginPaint(hwnd, &ps);
|
||||||
if (GetWindowLongW( hwnd, GWL_STYLE ) & SBS_SIZEBOX)
|
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
|
else
|
||||||
SCROLL_DrawScrollBar( hwnd, hdc, SB_CTL, TRUE, TRUE );
|
SCROLL_DrawScrollBar( hwnd, hdc, SB_CTL, TRUE, TRUE );
|
||||||
EndPaint( hwnd, &ps );
|
if (!wParam) EndPaint(hwnd, &ps);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
|
@ -252,10 +252,10 @@ static LRESULT StaticWndProc_common( HWND hwnd, UINT uMsg, WPARAM wParam,
|
||||||
case WM_PAINT:
|
case WM_PAINT:
|
||||||
{
|
{
|
||||||
PAINTSTRUCT ps;
|
PAINTSTRUCT ps;
|
||||||
BeginPaint(hwnd, &ps);
|
HDC hdc = wParam ? (HDC)wParam : BeginPaint(hwnd, &ps);
|
||||||
if (staticPaintFunc[style])
|
if (staticPaintFunc[style])
|
||||||
(staticPaintFunc[style])( hwnd, ps.hdc, full_style );
|
(staticPaintFunc[style])( hwnd, hdc, full_style );
|
||||||
EndPaint(hwnd, &ps);
|
if (!wParam) EndPaint(hwnd, &ps);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue