04-17-2019, 05:20 AM
Hello,
I added a countdown to the dialog, how to achieve a countdown to 0, Execution button run
Macro Dialog countdown
I added a countdown to the dialog, how to achieve a countdown to 0, Execution button run
Macro Dialog countdown
str dd=
;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 224 136 "Dialog" "4"
;3 Static 0x54000000 0x0 108 52 12 13 ""
;4 Button 0x54032000 0x0 88 72 48 14 "run"
;1 Button 0x54030001 0x4 116 116 48 14 "OK"
;2 Button 0x54030000 0x4 168 116 48 14 "Cancel"
;END DIALOG
;DIALOG EDITOR: "" 0x2040801 "*" "" "" ""
if(!ShowDialog(dd &sub.DlgProc 0)) ret
#sub DlgProc
function# hDlg message wParam lParam
str s
int- t=5
sel message
,case WM_INITDIALOG
,SetTimer hDlg 1 1000 0
,case WM_TIMER
,sel wParam
,,case 1
,,t-1
,,s=t; s.setwintext(id(3 hDlg))
,
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case IDOK
,case IDCANCEL
,case 4 ;;run
,mes "autorun ok"
ret 1