发送消息的时候一定要记得查消息的MSDN。

附加参数有时候很有用。

比如:

WM_SETICON

An application sends the WM_SETICON message to associate a new large or small icon with a window. The system displays the large icon in the ALT+TAB dialog box, and the small icon in the window caption.

To send this message, call the SendMessage function with the following parameters.

SendMessage(   (HWND) hWnd,              // handle to destination window   WM_SETICON,               // message to send  (WPARAM) wParam,          // icon type  (LPARAM) lParam          // handle to icon (HICON));

Parameters

wParam
Specifies the type of icon to be set. This parameter can be one of the following values.
ValueMeaning
ICON_BIG Set the large icon for the window.
ICON_SMALL Set the small icon for the window.

lParam
Handle to the new large or small icon. If this parameter is NULL, the icon indicated by wParam is removed.

Return Values

The return value is a handle to the previous large or small icon, depending on the value of wParam. It is NULL if the window previously had no icon of the type indicated by wParam.

原文地址:https://www.cnblogs.com/aoyihuashao/p/1624576.html