windows_programming_notes.nbk: Home | Index | Next Page: how to subclass a dialog control | Previous Page: Home
How To Handle Checkboxes
Defining Checkboxes in a dialog
CHECKBOX "Fixed", ID_FIXED, 85, 36, 30, 12
Read the Checkbox's state
UINT IsDlgButtonChecked(
HWND hDlg, // handle to dialog box
int nIDButton // button identifier
);
Change the Checkbox's state
BOOL CheckDlgButton(
HWND hDlg, // handle to dialog box
int nIDButton, // button identifier
UINT uCheck // check state
);
Possible Checkbox States
- BST_CHECKED
Button is checked.
BST_UNCHECKED
Button is cleared
BST_INDETERMINATE
Button is grayed, indicating an indeterminate state (applies only if the button has the BS_3STATE or BS_AUTO3STATE style).
From winuser.h:
#define BST_CHECKED 1
#define BST_INDETERMINATE 2
#define BST_UNCHECKED 0
windows_programming_notes.nbk: Home | Index | Next Page: how to subclass a dialog control | Previous Page: Home
Notebook exported on Monday, 7 July 2008, 18:56:50 PM Eastern Daylight Time