diff --git a/dlls/user/message.c b/dlls/user/message.c index 32c742227c7..f314c2b33b2 100644 --- a/dlls/user/message.c +++ b/dlls/user/message.c @@ -2278,17 +2278,8 @@ BOOL WINAPI PeekMessageW( MSG *msg_out, HWND hwnd, UINT first, UINT last, UINT f WIN_RestoreWndsLock( locks ); - /* need to fill the window handle for WM_PAINT message */ - if (msg.message == WM_PAINT) - { - if (IsIconic( msg.hwnd ) && GetClassLongW( msg.hwnd, GCL_HICON )) - { - msg.message = WM_PAINTICON; - msg.wParam = 1; - } - /* clear internal paint flag */ + if (msg.message == WM_PAINT) /* clear internal paint flag */ RedrawWindow( msg.hwnd, NULL, 0, RDW_NOINTERNALPAINT | RDW_NOCHILDREN ); - } if ((queue = QUEUE_Current())) { diff --git a/dlls/user/painting.c b/dlls/user/painting.c index e038c4f254c..53bad6d55a3 100644 --- a/dlls/user/painting.c +++ b/dlls/user/painting.c @@ -250,8 +250,7 @@ HDC WINAPI BeginPaint( HWND hwnd, PAINTSTRUCT *lps ) WIN_ReleasePtr( wndPtr ); if (lps->fErase) - lps->fErase = !SendMessageA( hwnd, bIcon ? WM_ICONERASEBKGND : WM_ERASEBKGND, - (WPARAM)lps->hdc, 0 ); + lps->fErase = !SendMessageA( hwnd, WM_ERASEBKGND, (WPARAM)lps->hdc, 0 ); TRACE("hdc = %p box = (%ld,%ld - %ld,%ld), fErase = %d\n", lps->hdc, lps->rcPaint.left, lps->rcPaint.top, lps->rcPaint.right, lps->rcPaint.bottom, diff --git a/windows/painting.c b/windows/painting.c index 70b6fb17689..49de5136bef 100644 --- a/windows/painting.c +++ b/windows/painting.c @@ -647,8 +647,7 @@ static HRGN RDW_Paint( WND* wndPtr, HRGN hrgn, UINT flags, UINT ex ) if (flags & RDW_UPDATENOW) { - if (wndPtr->hrgnUpdate) /* wm_painticon wparam is 1 */ - SendMessageW( hWnd, (bIcon) ? WM_PAINTICON : WM_PAINT, bIcon, 0 ); + if (wndPtr->hrgnUpdate) SendMessageW( hWnd, WM_PAINT, 0, 0 ); } else if (flags & RDW_ERASENOW) { @@ -674,8 +673,7 @@ static HRGN RDW_Paint( WND* wndPtr, HRGN hrgn, UINT flags, UINT ex ) dcx &= ~DCX_INTERSECTRGN; if (( hDC = GetDCEx( hWnd, hrgnRet, dcx )) ) { - if (SendMessageW( hWnd, (bIcon) ? WM_ICONERASEBKGND : WM_ERASEBKGND, - (WPARAM)hDC, 0 )) + if (SendMessageW( hWnd, WM_ERASEBKGND, (WPARAM)hDC, 0 )) wndPtr->flags &= ~WIN_NEEDS_ERASEBKGND; ReleaseDC( hWnd, hDC ); } diff --git a/windows/winproc.c b/windows/winproc.c index 07304f435db..c6fcc472fd3 100644 --- a/windows/winproc.c +++ b/windows/winproc.c @@ -2453,6 +2453,17 @@ INT WINPROC_MapMsg32ATo16( HWND hwnd, UINT msg32, WPARAM wParam32, *plparam = (LPARAM)next->hmenuIn; return 1; } + case WM_PAINT: + if (IsIconic( hwnd ) && GetClassLongW( hwnd, GCL_HICON )) + { + *pmsg16 = WM_PAINTICON; + *pwparam16 = 1; + } + return 0; + case WM_ERASEBKGND: + if (IsIconic( hwnd ) && GetClassLongW( hwnd, GCL_HICON )) + *pmsg16 = WM_ICONERASEBKGND; + return 0; case WM_PAINTCLIPBOARD: case WM_SIZECLIPBOARD: FIXME_(msg)("message %04x needs translation\n", msg32 );