Button_GetState
Gets the check state of a radio button or check box. You can use this
macro or send the BM_GETSTATE message explicitly.
Syntax
LRESULT Button_GetState(
HWND hwndCtl
);
Parameters
- hwndCtl
A handle to the button control.
Return Value
The return value specifies the current state of the button. You can use the following values to extract information about the state.
- 0x0003
Specifies the check state (radio buttons and check boxes only). A value of BST_UNCHECKED indicates the button is cleared; a value of BST_CHECKED indicates the button is checked. A radio button is checked when it contains a dot; a check box is checked when it contains an X. A value of BST_INDETERMINATE indicates the check state is indeterminate (applies only if the button has the BS_3STATE or BS_AUTO3STATE style). A three-state check box is grayed when its state is indeterminate.
BST_CHECKED
Indicates the button is checked.
BST_FOCUS
Specifies the focus state. A nonzero value indicates that the button
has the keyboard focus.
BST_INDETERMINATE
Indicates the button is grayed because the state of the button is indeterminate. This value applies only if the button has the BS_3STATE or BS_AUTO3STATE style.
BST_PUSHED
Specifies the highlight state. A nonzero value indicates that the button is highlighted. A button is automatically highlighted when the user positions the cursor over it and presses and holds the left mouse button. The highlighting is removed when the user releases the mouse button.
BST_UNCHECKED
Indicates the button is cleared. Same as a return value of zero.
Remarks
If the button has a style other than those listed, the return value is zero.
Macro Information
- Header Declared in Windowsx.h
- Minimum operating systems Windows 95, Windows NT 3.1