BCM_SETIMAGELIST message

Assigns an image list to a button control. You can send this message explicitly or use the Button_SetImageList macro.

Parameters

wParam

Not used; must be zero.

lParam

A pointer to a BUTTON_IMAGELIST structure that contains image list information.

Return value

If the message succeeds, it returns TRUE. Otherwise it returns FALSE.

Remarks

Note

To use this message, you must provide a manifest specifying Comclt32.dll version 6.0. For more information on manifests, see Enabling Visual Styles.

The image list referred to in the himl member of the BUTTON_IMAGELIST structure should contain either a single image to be used for all states or individual images for each state. The following states are defined in vssym32.h.

enum PUSHBUTTONSTATES {
    PBS_NORMAL = 1,
    PBS_HOT = 2,
    PBS_PRESSED = 3,
    PBS_DISABLED = 4,
    PBS_DEFAULTED = 5,
    PBS_STYLUSHOT = 6,
};

Note that PBS_STYLUSHOT is used only on tablet computers.

Each value is an index to the appropriate image in the image list. If only one image is present, it is used for all states. If the image list contains more than one image, each index corresponds to one state of the button. If an image is not provided for each state, nothing is drawn for those states without images.

Requirements

Requirement Value
Minimum supported client
Windows Vista [desktop apps only]
Minimum supported server
Windows Server 2003 [desktop apps only]
Header
Commctrl.h