An application sends the STM_SETICON message to associate an icon with an icon control.
STM_SETICON wParam = (WPARAM) (HICON) hicon; // handle of the icon lParam = 0; // not used; must be zero
The return value is the handle of the icon previously associated with the icon control, or zero if an error occurs.