What notification code is sent with the wm_command message to the dialog box procedure when a check box changes state?
And more importantly, where would I look in the msdn to find the notification codes for various controls?
What notification code is sent with the wm_command message to the dialog box procedure when a check box changes state?
And more importantly, where would I look in the msdn to find the notification codes for various controls?
It's BN_CLICKED
. The bottom of the page links to the button messages.
Note that Check boxes and Radio buttons are Buttons. So they send click and double click messages, BN_CLICKED
and BN_DOUBLECLICKED
.
If you use MFC, then you can examine the check
state with CButton::GetCheck method.
Otherwise you send the BM_GETCHECK message to the control: SendMessage(button_handle, BM_GETCHECK, 0, 0);
SendMessage
can return
BST_CHECKED
Button is checked.BST_INDETERMINATE
Button is grayed, indicating an indeterminate state
(applies only if the button has the BS_3STATE
or BS_AUTO3STATE
style).BST_UNCHECKED
Button is clearedIf you use the Visual Studio, the easiest way to get a list of events/messages a control can send is to go to Resource/Design view, right click a control and select Events.
For a list of common controls see: Control Library
(in the page you'll see a popup menu with the controls if you hover the cursor on the Control Library link)