The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: realcr on December 27, 2004, 11:41:31 AM

Title: CheckBoxes
Post by: realcr on December 27, 2004, 11:41:31 AM
How can I get the state of a checkbox? (checked , not checked)?

bar.
Title: Re: CheckBoxes
Post by: Ramon Sala on December 27, 2004, 12:12:17 PM
Hi realcr,

Invoke SendMessage, hWnd, BM_GETCHECK, 0, 0


hWnd = Handle for the check box


It returns BST_CHECKED (1) or BST_UNCHECKED (0) in Register Eax.

Regards,

Ramon
Title: Re: CheckBoxes
Post by: pbrennick on December 27, 2004, 12:26:09 PM
Hi realcr,
Be sure to read up about this topic in the win32.hlp file.  In addition to rsala's method, which works fine you can use The IsDlgButtonChecked function to determines whether a button control has a check mark next to it or whether a three-state button control is grayed, checked, or neither.
Paul
Title: Re: CheckBoxes
Post by: realcr on December 27, 2004, 12:38:24 PM
tnx for your help.

bar.