Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 CheckBox in Win32
Index -> Programming, C++ -> C++ Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
deville75




PostPosted: Wed Mar 28, 2007 2:17 pm   Post subject: 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?
Sponsor
Sponsor
Sponsor
sponsor
Andy




PostPosted: Wed Mar 28, 2007 2:24 pm   Post subject: 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




PostPosted: Wed Mar 28, 2007 2:31 pm   Post subject: Re: CheckBox in Win32

Andy @ Wed Mar 28, 2007 2:24 pm wrote:
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




PostPosted: Wed Mar 28, 2007 2:54 pm   Post subject: Re: CheckBox in Win32

Ok I figured it out:

code:

if (SendMessage(dev3cb, BM_GETSTATE, 0, 0) == BST_CHECKED)
                                view = CreateDialog (hInst, MAKEINTRESOURCE(IDD_VIEW), hWndDlg, reinterpret_cast<DLGPROC>(DlgViewProc));


Basically
code:
SendMessage(dev3cb, BM_GETSTATE,0,0)
returns BST_CHECKED, BST_UNCHECKED, or some other values I'm not worried about.
Display posts from previous:   
   Index -> Programming, C++ -> C++ Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 4 Posts ]
Jump to:   


Style:  
Search: