STM_SETICON

3.1

STM_SETICON
wParam = (WPARAM) (HICON) hicon;    /* handle of the icon     */
lParam = 0L;                        /* not used, must be zero */

An application sends an STM_SETICON message to associate an icon with an icon resource.

Parameters

hicon

Value of wParam. Identifies the icon to associate with the icon resource.

Return Value

The return value is the handle of the icon that was previously associated with the icon resource, or it is zero if an error occurred.

Example

This example associates the system-defined question-mark icon with an icon resource:

HICON hIcon, hOldIcon;

hIcon = LoadIcon((HANDLE) NULL, IDI_QUESTION);
hOldIcon = (HICON) SendDlgItemMessage(hdlg, IDD_ICON,
    STM_SETICON, hIcon, 0L);

See Also

STM_GETICON