Only send WM_PAINTICON and WM_ICONERASEBKGND to 16-bit windows (found

by Jeremy White).
This commit is contained in:
Alexandre Julliard 2004-10-07 03:09:37 +00:00
parent 486d020c1b
commit 998863bf63
4 changed files with 15 additions and 16 deletions

View file

@ -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()))
{

View file

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

View file

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

View file

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