don't click here

Help with win32 app in windows using C++

Discussion in 'Technical Discussion' started by Alriightyman, Jun 15, 2010.

  1. Alriightyman

    Alriightyman

    I am back... from the dead! Tech Member
    357
    11
    18
    Somewhere in hot, death Florida
    0101001101101111011011100110100101100011 00000010: 0101001100000011 01000101011001000110100101110100011010010110111101101110
    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):
    1. // other code... in dialog message loop
    2. switch (LOWORD(wParam)) {
    3.  
    4.     case IDC_NORMAL_BUTTON:
    5.       {
    6.             if ( /* check if radio button is checked */ )   //  unsure how to do this... in win32
    7.                        Function1();
    8.              else
    9.                        Function2();
    10. // other code...
    Any advice or help would be great!!
    Thanks.
     
  2. Synergy

    Synergy

    Member
    90
    0
    0
    UK
    Send a BM_GETCHECK message, using the control's handle as parameter. Return value gives you its state.

    Code (Text):
    1. if(SendMessage(hCtrl, BM_GETCHECK, 0, 0) == BST_CHECKED)
    2. {
    3.   // code here
    4. }
     
  3. Alriightyman

    Alriightyman

    I am back... from the dead! Tech Member
    357
    11
    18
    Somewhere in hot, death Florida
    0101001101101111011011100110100101100011 00000010: 0101001100000011 01000101011001000110100101110100011010010110111101101110
    Awsome! Thanks a lot!
     
  4. Sintendo

    Sintendo

    Member
    249
    0
    16