Associates a new image (icon or bitmap) with the button.
Syntax
To send this message, call the
SendMessage
function as follows.
lResult = SendMessage( // returns LRESULT in lResult
hWndControl, // (HWND) handle to destination control
BM_SETIMAGE, // (UINT) message ID
wParam, // = () wParam;
lParam // = () lParam;
);
Parameters
- wParam
-
The type of image to associate with the button. This parameter can be one of the following values:
- lParam
-
A handle to the image to associate with the button.
Return Value
The return value is a handle to the image previously associated with the button, if any; otherwise, it is NULL.
Remarks
The appearance of text, an icon, or both on a button control depends on the BS_ICON and BS_BITMAP styles, and whether the
BM_SETIMAGE message is called. The possible results are as follows:
| BS_ICON or BS_BITMAP Set? | BM_SETIMAGE Called? | Result |
|---|
| Yes | Yes | Show icon only. |
| No | Yes | Show icon and text. |
| Yes | No | Show text only. |
| No | No | Show text only |
Message Information
| Header | Declared in Winuser.h, include Windows.h |
|---|
| Minimum operating systems |
Windows 95, Windows NT 4.0 |
|---|
See Also
BM_GETIMAGE