IsDlgButtonChecked function

The IsDlgButtonChecked function determines whether a button control is checked or whether a three-state button control is checked, unchecked, or indeterminate.

Syntax

UINT IsDlgButtonChecked(
  HWND hDlg,
  int  nIDButton
);

Parameters

hDlg

Type: HWND

A handle to the dialog box that contains the button control.

nIDButton

Type: int

The identifier of the button control.

Return Value

Type: UINT

The return value from a button created with the BS_AUTOCHECKBOX, BS_AUTORADIOBUTTON, BS_AUTO3STATE, BS_CHECKBOX, BS_RADIOBUTTON, or BS_3STATE styles can be one of the values in the following table. If the button has any other style, the return value is zero.

Return code Description
BST_CHECKED
The button is checked.
BST_INDETERMINATE
The button is in an indeterminate state (applies only if the button has the BS_3STATE or BS_AUTO3STATE style).
BST_UNCHECKED
The button is not checked.

Remarks

The IsDlgButtonChecked function sends a BM_GETCHECK message to the specified button control.

Examples

For an example, see the section titled "Creating a Modeless Dialog Box" in Using Dialog Boxes.

Requirements

   
Minimum supported client Windows Vista [desktop apps only]
Minimum supported server Windows Server 2003 [desktop apps only]
Target Platform Windows
Header winuser.h (include Windows.h)
Library User32.lib
DLL User32.dll

See Also

CheckDlgButton