
-----------------------------------
deville75
Wed Mar 28, 2007 2:17 pm

CheckBox in Win32
-----------------------------------
I'm trying to use a checkbox, but I'm not sure how to check if the box has been checked or not.  Can anyone here help me?

-----------------------------------
Andy
Wed Mar 28, 2007 2:24 pm

Re: CheckBox in Win32
-----------------------------------
how are you implementing the checkbox? If you're using MFC, its quite easy. right click, and setaction or something.

-----------------------------------
deville75
Wed Mar 28, 2007 2:31 pm

Re: CheckBox in Win32
-----------------------------------
how are you implementing the checkbox? If you're using MFC, its quite easy. right click, and setaction or something.

I'm using Win32.  So I have a resource file that creates the checkbox and Now I just need to know whether it's being checked or not.  I'm guessing it's some sort of message.. I'm not sure.  I feel like I should know this but it's not coming to me.

-----------------------------------
deville75
Wed Mar 28, 2007 2:54 pm

Re: CheckBox in Win32
-----------------------------------
Ok I figured it out:


if (SendMessage(dev3cb, BM_GETSTATE, 0, 0) == BST_CHECKED)
				view = CreateDialog (hInst, MAKEINTRESOURCE(IDD_VIEW), hWndDlg, reinterpret_cast(DlgViewProc));

Basically SendMessage(dev3cb, BM_GETSTATE,0,0) returns BST_CHECKED, BST_UNCHECKED, or some other values I'm not worried about.
