CheckDlgButton function

Changes the check state of a button control.

Syntax


BOOL CheckDlgButton(
  _In_  HWND hDlg,
  _In_  int nIDButton,
  _In_  UINT uCheck
);

Parameters

hDlg [in]

Type: HWND

A handle to the dialog box that contains the button.

nIDButton [in]

Type: int

The identifier of the button to modify.

uCheck [in]

Type: UINT

The check state of the button. This parameter can be one of the following values.

ValueMeaning
BST_CHECKED

Sets the button state to checked.

BST_INDETERMINATE

Sets the button state to grayed, indicating an indeterminate state. Use this value only if the button has the BS_3STATE or BS_AUTO3STATE style.

BST_UNCHECKED

Sets the button state to cleared

 

Return value

Type: BOOL

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To get extended error information, call GetLastError.

Remarks

The CheckDlgButton function sends a BM_SETCHECK message to the specified button control in the specified dialog box.

Examples

For an example, see Creating a Modeless Dialog Box in Using Dialog Boxes.

Requirements

Minimum supported client

Windows 2000 Professional [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]

Header

Winuser.h (include Windows.h)

Library

User32.lib

DLL

User32.dll

See also

Reference
CheckRadioButton
IsDlgButtonChecked

 

 

Community Additions

ADD
Show:
© 2014 Microsoft