Your system time is invalid.
The SYSTEMTIME does not check to see if the date represented is a real and valid date.
Better to use DateTime class then convert to SYSTEMTIME.
The SYSTEMTIME does not check to see if the date represented is a real and valid date.
Better to use DateTime class then convert to SYSTEMTIME.
def DTM_SETSYSTEMTIME 0x00001002
str dd=
;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 224 136 "Dialog" "4"
;4 SysDateTimePick32 0x56030009 0x0 120 16 96 15 ""
;1 Button 0x54030001 0x4 116 116 48 14 "OK"
;2 Button 0x54030000 0x4 168 116 48 14 "Cancel"
;END DIALOG
;DIALOG EDITOR: "" 0x2040C02 "*" "" "" ""
DateTime dt1 dt2
if(!ShowDialog(dd &sub.DlgProc 0)) ret
#sub DlgProc v
function# hDlg message wParam lParam
SYSTEMTIME st1
sel message
,case WM_INITDIALOG
,dt1.FromComputerTime; dt1.AddParts(0 6);;AddParts([days] [hours] [minutes] [seconds] [ms] [^micros])
,st1=dt1.ToSYSTEMTIME
,SendMessage(id(4 hDlg) DTM_SETFORMAT 0 "H':'mm")
,SendMessage(id(4 hDlg) DTM_SETSYSTEMTIME GDT_VALID &st1)
,case WM_DESTROY
,case WM_COMMAND goto messages2
,case WM_NOTIFY goto messages3
ret
;messages2
sel wParam
,case IDOK
,case IDCANCEL
ret 1
;messages3
NMHDR* nh=+lParam
sel nh.code
,case DTN_DATETIMECHANGE
,NMDATETIMECHANGE* p=+nh
,if p.dwFlags=GDT_VALID
,,dt2.FromSYSTEMTIME(p.st)
,,out dt2.ToStr
,else out "empty"