BM_SETSTATE

2.x

BM_SETSTATE
wParam = (WPARAM) fState;   /* highlight state        */
lParam = 0L;                /* not used, must be zero */

An application sends a BM_SETSTATE message to set the highlight state of a button.

Parameters

fState

Value of wParam. Specifies whether the button is to be highlighted. A nonzero value highlights the button. A zero value removes any highlighting.

Return Value

The return value is always zero.

Comments

Highlighting affects the exterior of a button. It has no effect on the check state of a radio button or check box.

A button is automatically highlighted when the user presses and holds the left mouse button. The highlighting is removed when the user releases the mouse button.

Example

This example highlights and then removes highlighting from a push button, simulating the visual effect of a user clicking the button:

SendDlgItemMessage(hdlg, ID_MYPUSHBUTTON, BM_SETSTATE, TRUE, 0L);

     /*
      * Perform some action; then remove the highlighting,
      * thereby returning it to its normal state.
      */

SendDlgItemMessage(hdlg, ID_MYPUSHBUTTON, BM_SETSTATE, FALSE, 0L);

See Also

BM_GETSTATE, BM_SETCHECK