int GetCheck( ) const;
Value Meaning
0 Button state is unchecked.
1 Button state is checked.
2 Button state is indeterminate (applies only if the button has the BS_3STATE or BS_AUTO3STATE style).
If the button has any other style, the return value is 0.
Specifies the current state of the button control. You can use the following masks against the return value to extract information about the state:
Mask Meaning
0x0003 Specifies the check state (radio buttons and check boxes only). A 0 indicates the button is unchecked. A 1 indicates the button is checked. A radio button is checked when it contains a bullet (). A check box is checked when it contains an X. A 2 indicates the check state is indeterminate (three-state check boxes only). The state of a three-state check box is indeterminate when it contains a halftone pattern.
0x0004 Specifies the highlight state. A nonzero value indicates that the button is highlighted. A button is highlighted when the user clicks and holds the left mouse button. The highlighting is removed when the user releases the mouse button.
0x0008 Specifies the focus state. A nonzero value indicates that the button has the focus.
CButton::SetCheck
void SetCheck( int nCheck );
Parameters
nCheck
Specifies the check state. This parameter can be one of the following:
Value Meaning
0 Set the button state to unchecked.
1 Set the button state to checked.
2 Set the button state to indeterminate. This value can be used only if the button has the BS_3STATE or BS_AUTO3STATE style.