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?
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)
It's BN_CLICKED
. The bottom of the page links to the button messages.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With