diff --git a/include/winuser.h b/include/winuser.h index 9bc8d99d60e..d1b3d60bdba 100644 --- a/include/winuser.h +++ b/include/winuser.h @@ -938,6 +938,10 @@ typedef struct tagWINDOWPOS #define WA_ACTIVE 1 #define WA_CLICKACTIVE 2 +/* WM_GETICON/WM_SETICON params values */ +#define ICON_SMALL 0 +#define ICON_BIG 1 + /* WM_NCCALCSIZE parameter structure */ typedef struct { diff --git a/windows/defwnd.c b/windows/defwnd.c index 662856cce08..16c62385ed6 100644 --- a/windows/defwnd.c +++ b/windows/defwnd.c @@ -467,7 +467,25 @@ static LRESULT DEFWND_DefWinProc( WND *wndPtr, UINT msg, WPARAM wParam, case WM_QUERYOPEN: case WM_QUERYENDSESSION: return 1; + + case WM_SETICON: + case WM_GETICON: + { + LRESULT result = 0; + int index = GCL_HICON; + + if (wParam == ICON_SMALL) + index = GCL_HICONSM; + + result = GetClassLongA(wndPtr->hwndSelf, index); + + if (msg == WM_SETICON) + SetClassLongA(wndPtr->hwndSelf, index, lParam); + + return result; + } } + return 0; }