BM_GETCHECK

2.x

BM_GETCHECK
wParam = 0;     /* not used, must be zero */
lParam = 0L;    /* not used, must be zero */

An application sends a BM_GETCHECK message to retrieve the check state of a button.

Parameters

This message has no parameters.

Return Value

The return value from a button created with the BS_AUTOCHECKBOX, BS_AUTORADIOBUTTON, BS_AUTO3STATE, BS_CHECKBOX, BS_RADIOBUTTON, or BS_3STATE style may be one of the following values:

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.

Example

This example determines if the ID_MYCHECKBOX control is currently checked:

int checked;

checked = (int) SendDlgItemMessage(hwndDlg, ID_MYCHECKBOX,
    BM_GETCHECK, 0, 0L);

See Also

BM_GETSTATE, BM_SETCHECK