win32 API GUI - Radiobutton

Sep 9, 2012 at 3:18am
Once user press apply button, the option which is ticks by user will be process.
But how ? I tried googled but nothing comes up

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
BOOL CALLBACK DialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
    HWND hwndSHUTDOWN;

    switch(uMsg)
    {
        case WM_INITDIALOG:
            hwndSHUTDOWN = GetDlgItem(hWndDlg, IDC_SHUDOWNAFTER);
            SendMessage(hwndSHUTDOWN,BM_GETCHECK,0,0);
            return TRUE;

        case WM_CLOSE:
            EndDialog(hwndDlg, 0);
            return TRUE;

        case WM_COMMAND:
            switch(LOWORD(wParam))
            {
                case IDC_BTN_QUIT:
                    EndDialog(hwndDlg, 0);
                    return TRUE;

                case IDC_BTN_APPLY:
                    if (IsDlgButtonChecked(hWndDlg, IDC_SHUDOWNAFTER) == BST_CHECKED )
                    {
                        MessageBox(NULL,"TEST","TEST",NULL);
                    }
                    break;
                    return TRUE;
            }
    }

    return FALSE;
}


i tried to code like this but not working..
Sep 10, 2012 at 9:13am
when u click on that radio button, does it get checked?
does your code enter that part MessageBox(blavblabla)?

btw tutorial that u r looking into is a bit old
things have changed, DialogProc returns INT_PTR value (allthough your compiler doesn't say anything about BOOL, it's wrong)
Sep 10, 2012 at 9:22am
If your code is compiled for x86, it happens that "it works", but compiled for x64 platform most likely it will crash.
Sep 10, 2012 at 10:38am
so i have no luck to get this work then? :(
Topic archived. No new replies allowed.