09-25-2023, 11:41 AM
I added 6 hours to the hour field in the time, so the time now is 19:38. However, it is displayed as 0:00. I believe it should be displayed as 1:38.
Macro time3
Macro time3
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 t1 t2 dt
if(!ShowDialog(dd &sub.DlgProc 0)) ret
#sub DlgProc v
function# hDlg message wParam lParam
sel message
,case WM_INITDIALOG
,SYSTEMTIME st2; GetLocalTime &st2; st2.wHour+6
,SendMessage(id(4 hDlg) DTM_SETFORMAT 0 "H':'mm")
,SendMessage(id(4 hDlg) DTM_SETSYSTEMTIME GDT_VALID &st2)
,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
,,dt.FromSYSTEMTIME(p.st)
,,out dt.ToStr
,else out "empty"