Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Controlling macro from open dialog
#4
Function Dialog310
Code:
Copy      Help
/Dialog_Editor
function# hDlg message wParam lParam
if(hDlg) goto messages


;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 223 135 "Dialog"
;3 Button 0x54032000 0x0 6 4 48 14 "Start"
;4 Button 0x5C032000 0x0 6 22 48 14 "Stop"
;5 Edit 0x54030080 0x200 72 58 34 16 ""
;6 Static 0x54000000 0x0 6 58 60 16 "Number of times to loop"
;7 Edit 0x54030080 0x200 74 76 96 14 ""
;8 Static 0x54000000 0x0 6 76 60 14 "Success Message"
;2 Button 0x54030000 0x4 6 42 48 14 "Exit"
;END DIALOG
;DIALOG EDITOR: "" 0x2030502 "" "" "" ""

str controls = "5 7"
str e5 e7
if(!ShowDialog("Dialog310" &Dialog310 &controls)) ret
ret
;messages
sel message
,case WM_INITDIALOG
,case WM_DESTROY
,case WM_COMMAND goto messages2
,case WM_APP
,SetDlgItemText hDlg 7 F"{lParam%%s}"
,EnableWindow id(3 hDlg) 1; EnableWindow id(4 hDlg) 0
ret
;messages2
sel wParam
,case 3
,SetDlgItemText hDlg 7 ""
,EnableWindow id(3 hDlg) 0; EnableWindow id(4 hDlg) 1
,mac "Loop" "" hDlg _s.getwintext(id(5 hDlg))
,
,case 4
,shutdown -6 0 "Loop"
,EnableWindow id(3 hDlg) 1; EnableWindow id(4 hDlg) 0
,
,case IDCANCEL
ret 1

Function Loop
Code:
Copy      Help
;;function that accepts argumnents from dialog and returns success message to dialog
/
function hDlg e5

int i
for i 0 e5
,wait 1
,out i

SendMessage hDlg WM_APP 0 "success!"


Messages In This Thread

Forum Jump:


Users browsing this thread: 3 Guest(s)