Retrieves the date or date range of a Month Calendar control.
cGetCalDate (window-handle)
(i) window-handle Windows handle to a Month Calendar common control.
(s) list Date or date range in date-time format.
You can retrieve the date or date range of a Month Calendar control with this function. Month Calendar controls may or may not allow a date range to be specified. If the control you are retrieving allows the selection of a range of dates, the return string will be a tab-delimited list of the minimum and maximum dates. If the control does not allow range selection, the return string will contain a single date. In either case, the dates will be in the standard date-time format.
The class name for the Month Calendar control is "SysMonthCal32".
32-bit Extender
This function is designed for Windows 32-bit application controls. It cannot be used on Windows 64-bit controls.
64-bit Extender
This function is designed for Windows 64-bit application controls. It cannot be used on Windows on 32-bit controls.
AddExtender("wwctl44i.dll",0,"wwctl64i.dll")
; Get a handle hwndex = DllHwnd("Microsoft Control Spy") hwnd = cWndbyclass(hwndex,"CSPYContainer") hwnd = cWndbyclass(hwnd,"SysMonthCal32") ; Get the time set in the control. ctldates = cGetCalDate( hwnd ) If StrLen(ctldates) ;Does this control have a range. count =ItemCount(ctldates, @TAB) If count == 2 ;Get each time startdate = ItemExtract(1, ctldates, @TAB) enddate = ItemExtract(2, ctldates, @TAB) ; Are they the same date? If TimeDiffDays(startdate, enddate) == 0 dates = startdate Else dates = "From ":startdate:" to ":enddate:"." EndIf Message("Control date range", dates) Else Message("Control date", startdate) EndIf EndIf
cSetCalDate, cWndByClass, cWndInfo, DLLhwnd (WIL help).