CheckDlgButton

  BOOL CheckDlgButton(hwndDlg, idButton, uCheck)    
  HWND hwndDlg; /* handle of dialog box */
  int idButton; /* button-control identifier */
  UINT uCheck; /* check state */

The CheckDlgButton function selects (places a checkmark next to) or clears (removes a checkmark from) a button control, or it changes the state of a three-state button.

Parameters

hwndDlg

Identifies the dialog box that contains the button.

idButton

Identifies the button to modify.

uCheck

Specifies the check state of the button. If this parameter is nonzero, CheckDlgButton selects the button; if the parameter is zero, the function clears the button. For a three-state checkbox, if uCheck is 2, the button is grayed; if uCheck is 1, it is selected; if uCheck is 0, it is cleared.

Return Value

The return value is TRUE if the function was successful, or FALSE if an error occurred. Use the GetLastError function to obtain extended error information.

Comments

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

See Also

CheckRadioButton, IsDlgButtonChecked