03-19-2013, 09:44 PM
Hi, I used your example here and was able to create a dialog that could start and stop another macro
http://www.quickmacros.com/forum/showthr...p?tid=1954
IS it also possible to be able to send and retreive information from the dialog to another macro or function?
I think I need to use function as I want to compile it into an .exe and mac is not supported in this feature?
Here is the basic dialog that is working
Function Dialog3
And the macro it is controlling, if you click start it outputs the count and stop will stop the count.
Macro Loop1
What I would like to be able to do, is say have a text box on the dialog and the number entered there is sent to the function for the number of times to loop. And when done a success message is sent back to the dialog from the function, something like this, I am sure the syntax is not correct, but was not sure how to send the shutdown command to the function? When I run the macro and enter a number into the text box, nothing happens when I click start.
Function Dialog3
Function Loop
Thanks kindly Matt
http://www.quickmacros.com/forum/showthr...p?tid=1954
IS it also possible to be able to send and retreive information from the dialog to another macro or function?
I think I need to use function as I want to compile it into an .exe and mac is not supported in this feature?
Here is the basic dialog that is working
Function Dialog3
/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 0x54032000 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: "" 0x2030408 "" "" "" ""
str controls = "5 7"
str e5 e7
if(!ShowDialog("Dialog3" &Dialog3 &controls)) ret
ret
;messages
sel message
,case WM_INITDIALOG
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case 3
, mac "Loop"
,
,case 4
, shutdown -6 0 "Loop"
,
,case IDCANCEL
ret 1
And the macro it is controlling, if you click start it outputs the count and stop will stop the count.
Macro Loop1
What I would like to be able to do, is say have a text box on the dialog and the number entered there is sent to the function for the number of times to loop. And when done a success message is sent back to the dialog from the function, something like this, I am sure the syntax is not correct, but was not sure how to send the shutdown command to the function? When I run the macro and enter a number into the text box, nothing happens when I click start.
Function Dialog3
/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 0x54032000 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: "" 0x2030408 "" "" "" ""
str controls = "5 7"
str e5 e7
if(!ShowDialog("Dialog3" &Dialog3 &controls)) ret
ret
;messages
sel message
,case WM_INITDIALOG
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case 3
, mac Loop(0 val(e5))
, e7=success
,case 4
, shutdown -6 0 Loop(0 0)
,
,case IDCANCEL
ret 1
Function Loop
;;function that accepts argumnents from dialog and returns success message to dialog
/
function int'count int'e5 str'message
message="success!"
for count 1 e5
,wait 1
,out count
ret message
Thanks kindly Matt