-
I know how to create radio buttons and check boxes, but I need to know....
How can you tell whether they are checked or not?
I know i can have a boolean variable, and wait for the WM_COMMAND message, and set that variable to true. or false when one is checked... but is there a better way?
Thanks,
Dennis
-
If your window is a dialog then you can use this:
Code:
if (LOWORD(wParam)==IDC_CHECK1)
{
if(IsDlgButtonChecked(hDlg,IDC_CHECK1)==BST_CHECKED)
{
//do something
}
else
{
//do something
}
}
-
it's not a dialog.. it's made with CreateWindowEx(),
thanks anyway, but I think I am going to go with the way I was originally going to. :)
Dennis
-
My way worked fine... but incase any of you are wondering...
there is a better way to do it.
Code:
int res = SendMessage(hWnd,BM_GETCHECK, 0, 0);
return values
BST_CHECKED = 1
BST_INDETERMINATE = 2
BST_UNCHECKED = 0