win32u: Move default WM_GETICON implementation from user32.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Jacek Caban 2022-05-11 20:14:50 +02:00 committed by Alexandre Julliard
parent fc4067a2ac
commit 1f296397ca
2 changed files with 34 additions and 27 deletions

View File

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

View File

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