|
-
Dec 23rd, 2000, 02:15 PM
#1
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
-
Dec 23rd, 2000, 04:01 PM
#2
Frenzied Member
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
}
}
-
Dec 23rd, 2000, 05:07 PM
#3
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
-
Dec 24th, 2000, 05:27 PM
#4
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|