user5580103
user5580103

Reputation:

C Win32 API: Set state of check box

I would like a check box to be automatically unchecked when a certain value is reached. But I can't find an option to set the state of a check box

Upvotes: 5

Views: 4982

Answers (1)

Send it a BM_SETCHECK message:

SendMessage(hWndOfCheckbox, BM_SETCHECK, BST_UNCHECKED, 0);

Alternatively, use the Button_SetCheck macro, that expands to the same call to SendMessage (but doesn't expose unused formal parameters):

Button_SetCheck(hWndOfCheckbox, BST_UNCHECKED);

Upvotes: 11

Related Questions