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

Method ControlSetDateTime

source/script_gui.cpp:1868–1887  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1866
1867
1868ResultType GuiType::ControlSetDateTime(GuiControlType &aControl, LPTSTR aContents, ResultToken &aResultToken)
1869{
1870 SYSTEMTIME st;
1871 if (*aContents)
1872 {
1873 if (YYYYMMDDToSystemTime(aContents, st, true))
1874 DateTime_SetSystemtime(aControl.hwnd, GDT_VALID, &st);
1875 else
1876 _o_throw_value(ERR_INVALID_VALUE, aContents);
1877 }
1878 else // User wants there to be no date selection.
1879 {
1880 // Ensure the DTS_SHOWNONE style is present, otherwise it won't work. However,
1881 // it appears that this style cannot be applied after the control is created, so
1882 // this line is commented out:
1883 //SetWindowLong(aControl.hwnd, GWL_STYLE, GetWindowLong(aControl.hwnd, GWL_STYLE) | DTS_SHOWNONE);
1884 DateTime_SetSystemtime(aControl.hwnd, GDT_NONE, &st); // Contents of st are ignored in this mode.
1885 }
1886 return OK;
1887}
1888
1889
1890ResultType GuiType::ControlSetDateTimeFormat(GuiControlType &aControl, LPTSTR aFormat, ResultToken &aResultToken)

Callers

nothing calls this directly

Calls 1

YYYYMMDDToSystemTimeFunction · 0.85

Tested by

no test coverage detected