I'm still learning Win32 apps in C++, and I can't seem to find any information on how to check if a radio button or checkbox button is checked. I can find it for using MCF apps, but I'd like to stay away from that for now. Anyway, I created a dialog box with a few radio buttons and a couple "normal" buttons, and when the user clicks on one of the "normal" buttons, the program should check which radio button is checked and do something different. Example: Code (Text): // other code... in dialog message loop switch (LOWORD(wParam)) { case IDC_NORMAL_BUTTON: { if ( /* check if radio button is checked */ ) // unsure how to do this... in win32 Function1(); else Function2(); // other code... Any advice or help would be great!! Thanks.
Send a BM_GETCHECK message, using the control's handle as parameter. Return value gives you its state. Code (Text): if(SendMessage(hCtrl, BM_GETCHECK, 0, 0) == BST_CHECKED) { // code here }