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

Method ControlSetMonthCal

source/script_gui.cpp:1932–1949  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1930
1931
1932ResultType GuiType::ControlSetMonthCal(GuiControlType &aControl, LPTSTR aContents, ResultToken &aResultToken)
1933{
1934 SYSTEMTIME st[2];
1935 DWORD gdtr = YYYYMMDDToSystemTime2(aContents, st);
1936 if (!gdtr) // aContents is empty or invalid (it's not meaningful to set an empty value).
1937 _o_throw_value(ERR_INVALID_VALUE, aContents);
1938 if (GetWindowLong(aControl.hwnd, GWL_STYLE) & MCS_MULTISELECT) // Must use range-selection even if selection is only one date.
1939 {
1940 if (gdtr == GDTR_MIN) // No maximum is present, so set maximum to minimum.
1941 st[1] = st[0];
1942 //else both are present.
1943 MonthCal_SetSelRange(aControl.hwnd, st);
1944 }
1945 else
1946 MonthCal_SetCurSel(aControl.hwnd, st);
1947 ControlRedraw(aControl, true); // Confirmed necessary.
1948 return OK;
1949}
1950
1951
1952ResultType GuiType::ControlGetMonthCal(ResultToken &aResultToken, GuiControlType &aControl)

Callers

nothing calls this directly

Calls 1

YYYYMMDDToSystemTime2Function · 0.85

Tested by

no test coverage detected