BM SETCHECK
This message sets the checked state of a button control.
Syntax
param1 USHORT uscheck; /* Check state. */ param2 ULONG ulReserved; /* Reserved value, should be 0. */
Parameters
- uscheck (USHORT) - input
- Check state.
- 0: Display the button control in the unchecked state.
- 1: Display the button control in the checked state.
- 2: Display a 3-state button control in the indeterminate state.
- ulReserved (ULONG) - input
- Reserved value, should be 0.
Returns
- usoldstate (USHORT) - returns
- Old check state of the button control.
- 0: Unchecked.
- 1: Checked.
- 2: Indeterminate.
Remarks
The button control responds to this message by displaying it in the appropriate state and returning the old state.
If the button control has the style of BS_CHECKBOX, BS_AUTOCHECKBOX, BS_RADIOBUTTON, or BS_AUTORADIOBUTTON, it is displayed in the checked state if uscheck is set to 1, or in the unchecked state if it is set to 0 and usoldstate is set as appropriate.
If the button control has the style of BS_RADIOBUTTON or BS_AUTORADIOBUTTON, the WS_TABSTOP style is modified. If the resulting state of the button is checked, the WS_TABSTOP style is set, otherwise it is reset.
If the button control has the style of BS_3STATE or BS_AUTO3STATE, it is displayed in the unchecked state if uscheck is set to 0, in the checked state if it is set to 1, and in the indeterminate state if it is set to 2 and usoldstate is set as appropriate.
If the button control has the style of BS_USERBUTTON, a WM_CONTROL (in Button Controls) message is sent to its owner with usnotifycode set to BN_PAINT and usoldstate is set as appropriate.
If the button control has any other style, the button control takes no action other than to set usoldstate to 0.
Default Processing
The default window procedure does not expect to receive this message and therefore takes no action on it, except to set usoldstate to the default value of 0.