Commit 11dd274c authored by Alexandre Julliard's avatar Alexandre Julliard

Erase only client area on WM_ERASEBKGND.

parent 647ac511
...@@ -457,20 +457,15 @@ static LRESULT DEFWND_DefWinProc( WND *wndPtr, UINT msg, WPARAM wParam, ...@@ -457,20 +457,15 @@ static LRESULT DEFWND_DefWinProc( WND *wndPtr, UINT msg, WPARAM wParam,
case WM_ICONERASEBKGND: case WM_ICONERASEBKGND:
{ {
RECT rect; RECT rect;
HDC hdc = (HDC)wParam;
HBRUSH hbr = GetClassLongW( wndPtr->hwndSelf, GCL_HBRBACKGROUND ); HBRUSH hbr = GetClassLongW( wndPtr->hwndSelf, GCL_HBRBACKGROUND );
if (!hbr) return 0; if (!hbr) return 0;
/* Since WM_ERASEBKGND may receive either a window dc or a */ /* GetClientRect used to be GetClipBox, but it is not what
/* client dc, the area to be erased has to be retrieved from */ * Windows does, and it breaks badly with CS_PARENTDC */
/* the device context. */ GetClientRect( wndPtr->hwndSelf, &rect );
GetClipBox( (HDC)wParam, &rect ); DPtoLP( hdc, (LPPOINT)&rect, 2 );
FillRect( hdc, &rect, hbr );
/* Always call the Win32 variant of FillRect even on Win16,
* since despite the fact that Win16, as well as Win32,
* supports special background brushes for a window class,
* the Win16 variant of FillRect does not.
*/
FillRect( (HDC) wParam, &rect, hbr );
return 1; return 1;
} }
......
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