Programming |  Windows Programming |  BM_SETIMAGE

BM_SETIMAGE

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     
       (HWND) hWndControl,      // handle to destination control     
       (UINT) BM_SETIMAGE,      // message ID     
       (WPARAM) wParam,         // = (WPARAM) () wParam;    
       (LPARAM) lParam          // = (LPARAM) () lParam; 
    );   

Parameters

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:

Message Information