From: Jacek Caban jacek@codeweavers.com
Signed-off-by: Jacek Caban jacek@codeweavers.com --- dlls/user32/defwnd.c | 30 +++--------------------------- dlls/win32u/defwnd.c | 31 +++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 27 deletions(-)
diff --git a/dlls/user32/defwnd.c b/dlls/user32/defwnd.c index 047822d00d6..67cb77a3121 100644 --- a/dlls/user32/defwnd.c +++ b/dlls/user32/defwnd.c @@ -262,9 +262,6 @@ static LRESULT DEFWND_DefWinProc( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPa case WM_NCACTIVATE: return NC_HandleNCActivate( hwnd, wParam, lParam );
- case WM_NCDESTROY: - return NtUserMessageCall( hwnd, msg, wParam, lParam, 0, NtUserDefWindowProc, FALSE ); - case WM_PRINT: DEFWND_Print(hwnd, (HDC)wParam, lParam); return 0; @@ -524,30 +521,6 @@ static LRESULT DEFWND_DefWinProc( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPa return res; }
- case WM_GETICON: - { - HICON ret; - WND *wndPtr = WIN_GetPtr( hwnd ); - - switch(wParam) - { - case ICON_SMALL: - ret = wndPtr->hIconSmall; - break; - case ICON_BIG: - ret = wndPtr->hIcon; - break; - case ICON_SMALL2: - ret = wndPtr->hIconSmall ? wndPtr->hIconSmall : wndPtr->hIconSmall2; - break; - default: - ret = 0; - break; - } - WIN_ReleasePtr( wndPtr ); - return (LRESULT)ret; - } - case WM_HELP: SendMessageW( GetParent(hwnd), msg, wParam, lParam ); break; @@ -614,6 +587,9 @@ static LRESULT DEFWND_DefWinProc( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPa break; }
+ default: + return NtUserMessageCall( hwnd, msg, wParam, lParam, 0, NtUserDefWindowProc, FALSE ); + }
return 0; diff --git a/dlls/win32u/defwnd.c b/dlls/win32u/defwnd.c index 1fa80928c65..3aa5a8286b3 100644 --- a/dlls/win32u/defwnd.c +++ b/dlls/win32u/defwnd.c @@ -112,6 +112,33 @@ static BOOL set_window_text( HWND hwnd, const void *text, BOOL ansi ) return TRUE; }
+static HICON get_window_icon( HWND hwnd, WPARAM type ) +{ + HICON ret; + WND *win; + + if (!(win = get_win_ptr( hwnd ))) return 0; + + switch(type) + { + case ICON_SMALL: + ret = win->hIconSmall; + break; + case ICON_BIG: + ret = win->hIcon; + break; + case ICON_SMALL2: + ret = win->hIconSmall ? win->hIconSmall : win->hIconSmall2; + break; + default: + ret = 0; + break; + } + + release_win_ptr( win ); + return ret; +} + static HICON set_window_icon( HWND hwnd, WPARAM type, HICON icon ) { HICON ret = 0; @@ -227,6 +254,10 @@ LRESULT default_window_proc( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam, result = (LRESULT)set_window_icon( hwnd, wparam, (HICON)lparam ); break;
+ case WM_GETICON: + result = (LRESULT)get_window_icon( hwnd, wparam ); + break; + case WM_SYSCOMMAND: result = handle_sys_command( hwnd, wparam, lparam ); break;