Checkbox - change notification

What notification code is sent with the wm_command message to the dialog box procedure when the checkbox changes state?

And more importantly, where would I look in msdn to find notification codes for various controls?

+6
windows checkbox winapi
source share
2 answers

Please note that radio buttons and buttons are buttons. Therefore, they send clicks and double clicks, BN_CLICKED and BN_DOUBLECLICKED .

If you use MFC, you can examine the state of check using the CButton :: GetCheck method . Otherwise, you send a BM_GETCHECK message to the control: SendMessage(button_handle, BM_GETCHECK, 0, 0);

SendMessage can return

  • BST_CHECKED Button is BST_CHECKED .
  • BST_INDETERMINATE The button is gray, indicating an undefined state (applies only if the button has the style BS_3STATE or BS_AUTO3STATE ).
  • BST_UNCHECKED Button cleared
  • If the button has a style other than those listed, the return value is zero.

If you are using Visual Studio, the easiest way to get a list of events / messages that a control can send is to go to the Resource / Design view, right-click the control, and select Events.

For a list of common controls, see: Control Library
(on the page you will see a pop-up menu with controls if you hover over the Control Library link)

+6
source share

This is BN_CLICKED . The bottom of the page refers to button messages.

+2
source share

All Articles