Sent to a window to retrieve a handle to the large or small icon associated with a window. The system displays the large icon in the ALT+TAB dialog, and the small icon in the window caption.
A window receives this message through its WindowProc function.
#define WM_GETICON 0x007F
The type of icon being retrieved. This parameter can be one of the following values.
Retrieve the large icon for the window.
Retrieve the small icon for the window.
Retrieves the small icon provided by the application. If the application does not provide one, the system uses the system-generated icon for that window.
The DPI of the icon being retrieved. This can be used to provide different icons depending on the icon size.
The return value is a handle to the large or small icon, depending on the value of wParam. When an application receives this message, it can return a handle to a large or small icon, or pass the message to the DefWindowProc function.
When an application receives this message, it can return a handle to a large or small icon, or pass the message to DefWindowProc.
DefWindowProc returns a handle to the large or small icon associated with the window, depending on the value of wParam.
A window that has no icon explicitly set (with WM_SETICON) uses the icon for the registered window class, and in this case DefWindowProc will return 0 for a WM_GETICON message. If sending a WM_GETICON message to a window returns 0, next try calling the GetClassLongPtr function for the window. If that returns 0 then try the LoadIcon function.
|Minimum supported client
||Windows 2000 Professional [desktop apps only]
|Minimum supported server
||Windows 2000 Server [desktop apps only]