Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
wait with dialog
#3
Function Dialog64
Code:
Copy      Help
str dd=
;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 224 136 "Dialog"
;100 Static 0x54000000 0x0 8 100 208 13 ""
;1 Button 0x54030001 0x4 116 116 48 14 "OK"
;2 Button 0x54030000 0x4 168 116 48 14 "Cancel"
;END DIALOG
;DIALOG EDITOR: "" 0x2040700 "*" "" "" ""

sel ShowDialog(dd &sub.DlgProc 0)
,case IDOK out "OK"
,case 12345 out "timeout"
,case else ret ;;Cancel


#sub DlgProc
function# hDlg message wParam lParam

int-- t_time

sel message
,case WM_INITDIALOG
,t_time=10 ;;edit this if need
,SetTimer hDlg 1 1000 0
,
,case WM_TIMER
,sel wParam
,,case 1
,,t_time-1
,,if(t_time=0) DT_Ok hDlg 12345
,,else SetDlgItemText hDlg 100 F"Will close after {t_time} s. Click here to stop the timer."
,
,case [WM_LBUTTONDOWN,WM_NCLBUTTONDOWN] ;;clicked a non-control part of the dialog
,KillTimer hDlg 1
,
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case IDOK
,case IDCANCEL
ret 1


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)