putting and controling radio group

This is a discussion on putting and controling radio group within the Windows Programming forums, part of the Platform Specific Boards category; I wnat to have a group of 4 radiobuttons in one dialog box When some of buttons are selected I ...

  1. #1
    Registered User
    Join Date
    Sep 2003
    Posts
    87

    Lightbulb putting and controling radio group

    I wnat to have a group of 4 radiobuttons in one dialog box

    When some of buttons are selected I want to disable or enable some edit boxes. I can't catch messages sent from radiobuttons.

    All I need is a little help in the dialog's callback function...

    BOOL CALLBACK DlgProc(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lParam)
    {
    switch(uMsg)
    {
    case WM_COMMAND:
    switch(wParam)
    {
    case IDOK:
    case IDCANCEL:
    DestroyWindow(hwndDlg);
    default:;
    }
    }
    return 0;
    }

    If somebody can insert here the code that catches the message...

    Please help!

    P.S. Thank you in advance.
    Last edited by Gravedigga; 09-24-2003 at 07:00 AM.

  2. #2
    pronounced 'fib' FillYourBrain's Avatar
    Join Date
    Aug 2002
    Posts
    2,297
    Code:
    BOOL CALLBACK DlgProc(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lParam)
    {
    switch(uMsg)
       {
       case WM_COMMAND:
       switch(HIWORD(wParam))
          {
          case BN_CLICKED:
             //LOWORD(wParam) is the ID of the button that was clicked
             //do something with it.
             break;
          case IDOK:
          case IDCANCEL:
             DestroyWindow(hwndDlg);
          default:
          }
       }
    return 0;
    }
    "You are stupid! You are stupid! Oh, and don't forget, you are STUPID!" - Dexter

Popular pages Recent additions subscribe to a feed

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21