Guy named Jon Guy named Jon - 1 year ago 175
C Question

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 staye of a check box

Answer Source

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);
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download