MCPcopy Create free account
hub / github.com/AutoHotkey/AutoHotkey / ControlSetCheck

Method ControlSetCheck

source/script_gui.cpp:1589–1604  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1587
1588
1589ResultType GuiType::ControlSetCheck(GuiControlType &aControl, int checked, ResultToken &aResultToken)
1590{
1591 if ( !(checked == 0 || checked == 1 || (aControl.type == GUI_CONTROL_CHECKBOX && checked == -1)) )
1592 _o_throw_value(ERR_INVALID_VALUE);
1593 if (checked == -1)
1594 checked = BST_INDETERMINATE;
1595 //else the "checked" var is already set correctly.
1596 if (aControl.type == GUI_CONTROL_RADIO)
1597 {
1598 ControlCheckRadioButton(aControl, GUI_HWND_TO_INDEX(aControl.hwnd), checked);
1599 return OK;
1600 }
1601 // Otherwise, we're operating upon a checkbox.
1602 SendMessage(aControl.hwnd, BM_SETCHECK, checked, 0);
1603 return OK;
1604}
1605
1606
1607ResultType GuiType::ControlGetCheck(ResultToken &aResultToken, GuiControlType &aControl)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected