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

Method ControlGetDDL

source/script_gui.cpp:1656–1668  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1654
1655
1656ResultType GuiType::ControlGetDDL(ResultToken &aResultToken, GuiControlType &aControl, ValueModeType aMode)
1657{
1658 LRESULT index;
1659 if (aMode == Value_Mode || (aMode == Submit_Mode && (aControl.attrib & GUI_CONTROL_ATTRIB_ALTSUBMIT))) // Caller wants the position, not the text.
1660 {
1661 index = SendMessage(aControl.hwnd, CB_GETCURSEL, 0, 0); // Get index of currently selected item.
1662 // If there's no item selected (the default state, and also possible by Value:=0
1663 // or Text:=""), index is -1 (CB_ERR). Since Value:=0 is valid and Value:=""
1664 // is not, return 0 in that case. MSDN: "If no item is selected, it is CB_ERR."
1665 _o_return((int)index + 1);
1666 }
1667 return ControlGetWindowText(aResultToken, aControl);
1668}
1669
1670
1671ResultType GuiType::ControlGetComboBox(ResultToken &aResultToken, GuiControlType &aControl, ValueModeType aMode)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected