diff --git a/dlls/user32/defwnd.c b/dlls/user32/defwnd.c index be41f6c47a0..dcc0f4d2138 100644 --- a/dlls/user32/defwnd.c +++ b/dlls/user32/defwnd.c @@ -75,45 +75,6 @@ HBRUSH DEFWND_ControlColor( HDC hDC, UINT ctlType ) } -/*********************************************************************** - * DEFWND_Print - * - * This method handles the default behavior for the WM_PRINT message. - */ -static void DEFWND_Print( HWND hwnd, HDC hdc, ULONG uFlags) -{ - /* - * Visibility flag. - */ - if ( (uFlags & PRF_CHECKVISIBLE) && - !IsWindowVisible(hwnd) ) - return; - - /* - * Unimplemented flags. - */ - if ( (uFlags & PRF_CHILDREN) || - (uFlags & PRF_OWNED) || - (uFlags & PRF_NONCLIENT) ) - { - WARN("WM_PRINT message with unsupported flags\n"); - } - - /* - * Background - */ - if ( uFlags & PRF_ERASEBKGND) - SendMessageW(hwnd, WM_ERASEBKGND, (WPARAM)hdc, 0); - - /* - * Client area - */ - if ( uFlags & PRF_CLIENT) - SendMessageW(hwnd, WM_PRINTCLIENT, (WPARAM)hdc, uFlags); -} - - - /*********************************************************************** * DEFWND_DefWinProc * @@ -157,10 +118,6 @@ static LRESULT DEFWND_DefWinProc( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPa } break; - case WM_PRINT: - DEFWND_Print(hwnd, (HDC)wParam, lParam); - return 0; - case WM_SYSCOMMAND: return NC_HandleSysCommand( hwnd, wParam, lParam ); diff --git a/dlls/win32u/defwnd.c b/dlls/win32u/defwnd.c index 506ff0f9fd9..0470ed77eac 100644 --- a/dlls/win32u/defwnd.c +++ b/dlls/win32u/defwnd.c @@ -2621,6 +2621,16 @@ LRESULT default_window_proc( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam, break; } + case WM_PRINT: + if ((lparam & PRF_CHECKVISIBLE) && !is_window_visible ( hwnd )) break; + + if (lparam & (PRF_CHILDREN | PRF_OWNED | PRF_NONCLIENT)) + WARN( "WM_PRINT message with unsupported lparam %lx\n", lparam ); + + if (lparam & PRF_ERASEBKGND) send_message( hwnd, WM_ERASEBKGND, wparam, 0 ); + if (lparam & PRF_CLIENT) send_message(hwnd, WM_PRINTCLIENT, wparam, lparam ); + break; + case WM_APPCOMMAND: { HWND parent = get_parent( hwnd );