Every static control is associated with a 32-bit data field. A static control with the SS_BITMAP or SS_ICON style uses this field to store the handle of the bit map or icon that it displays. An application can obtain that handle by sending the SM_QUERYHANDLE message to the control. An application can replace the bit map or icon by sending the SM_SETHANDLE message to the control, specifying a valid icon or bit map handle. Changing the handle causes the system to redraw the control.
For a non-icon or non-bit map static control, the data field is available for application-defined data and has no effect on the appearance of the control.
An application can retrieve the data field of a static control window by calling WinWindowFromID, using the handle of the owner and the window identifier of the static control. The static control window identifier is specified in either the dialog-window template or WinCreateWindow.