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)
Nick dandoulakis
source share