Guy named Jon Guy named Jon - 3 months ago 18
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

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);
Comments