Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
delay start of function with dialog
#1
Hi,

I have created a dialog box that I use to launch various functions which works really well, but I'd like add a feature to the dialog box that would allow me to select a date and time in order to delay the start of function(s) selected.  I've tried with the advanced -> SysDateTimePick32 option, but don't understand how to use this option. 

I mean it does create the DateTime picker dropdown in the dialog box, but then I can't understand how to use the dateTime selected to control the function start time. 

Any help would be greatly appreciated. 


Jim
#2
Macro dialog with SysDateTimePick32 controls
Code:
Copy      Help
str dd=
;BEGIN DIALOG
;0 "" 0x10C80A48 0x100 0 0 223 135 "Form"
;1 Button 0x54030001 0x4 120 116 48 14 "OK"
;2 Button 0x54030000 0x4 170 116 48 14 "Cancel"
;3 SysDateTimePick32 0x54000000 0x204 8 10 110 14 ""
;4 SysDateTimePick32 0x54000001 0x204 8 32 110 14 ""
;5 SysDateTimePick32 0x54000009 0x204 8 54 110 14 ""
;6 SysDateTimePick32 0x54000004 0x204 8 78 110 14 ""
;END DIALOG
;DIALOG EDITOR: "" 0x2040701 "*" "" "" ""

DateTime t1 t2 t3

if(!ShowDialog(dd &sub.DlgProc 0)) ret

out t1.ToStr
out t2.ToStr
out t3.ToStr(4)


#sub DlgProc v
function# hDlg message wParam lParam

SYSTEMTIME st1 st2 st3

sel message
,case WM_INITDIALOG
,;here the controls can be initialized using SendMessage DTM_SETSYSTEMTIME. Use Google to find reference.
,
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case IDOK
,SendMessage(id(3 hDlg) DTM_GETSYSTEMTIME 0 &st1); t1.FromSYSTEMTIME(st1)
,SendMessage(id(4 hDlg) DTM_GETSYSTEMTIME 0 &st2); t2.FromSYSTEMTIME(st2)
,SendMessage(id(5 hDlg) DTM_GETSYSTEMTIME 0 &st3); t3.FromSYSTEMTIME(st3)
,
,case IDCANCEL
ret 1


Forum Jump:


Users browsing this thread: 1 Guest(s)