Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Running a certain macro from dialog
#1
Ok when I click on the button for my dialog to run the macro it will not run here is my dialog that i made so far. Just a quick one.

Code:
Copy      Help
;\Dialog_Editor

;BEGIN DIALOG
;0 "" 0x90C80A44 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 Button 0x54032000 0x0 124 34 48 14 "Minimize"
;END DIALOG
;DIALOG EDITOR: "" 0x2010808 "" ""

mac "Minimize QM"; err
#2
Create smart dialog, click the button, click Events, OK and add the code there.

Code:
Copy      Help
;\Dialog_Editor
function# hDlg message wParam lParam
if(hDlg) goto messages

;BEGIN DIALOG
;0 "" 0x90C80A44 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 Button 0x54032000 0x0 124 34 48 14 "Minimize"
;END DIALOG
;DIALOG EDITOR: "" 0x2010808 "" ""


ret
;messages
sel message
,case WM_INITDIALOG
,DT_Init(hDlg lParam) ;;not necessary in QM >= 2.1.9
,ret 1 ;;not necessary in QM >= 2.1.9
,case WM_DESTROY DT_DeleteData(hDlg) ;;not necessary in QM >= 2.1.9
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case 3
,mac "Minimize QM"; err

,case IDOK
,DT_Ok hDlg ;;not necessary in QM >= 2.1.9
,case IDCANCEL DT_Cancel hDlg ;;not necessary in QM >= 2.1.9
ret 1
#3
im not sure on what i am doing i tried to create a smart dialog except when i press the Minimize QM button it will not run the macro.
#4
Show all your code, ie dialog function and function or macro where is ShowDialog, and their names.
#5
Ok i have a dialog here is the code in the dialog

Code:
Copy      Help
;\Dialog_Editor
function# hDlg message wParam lParam
if(hDlg) goto messages

;BEGIN DIALOG
;0 "" 0x90C80A44 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 Button 0x54032000 0x0 70 116 48 14 "Minimize QM"
;END DIALOG
;DIALOG EDITOR: "" 0x2010808 "" ""


ret
;messages
if(message=WM_INITDIALOG) DT_Init(hDlg lParam)
;int param=DT_GetParam(hDlg)

sel message
,case WM_INITDIALOG
,ret 1
,case WM_DESTROY DT_DeleteData(hDlg)
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case IDOK DT_Ok hDlg
,case IDCANCEL DT_Cancel hDlg
ret 1

then i have a macro called Minimize QM the code in there is.......

Code:
Copy      Help
spe 1
rep 1
,min "Quick Macros"; err

When I open the dialog from a nother function called Function which has the code
Code:
Copy      Help
if(!ShowDialog("Dialog10" &Dialog10)) ret
to show the dialog, when I press Minimize QM i want it to run the macro Minimize QM.
#6
just insert case 3 mac ..., like in example.
#7
do i insert that in the dialog or the function that shows the dialog?
#8
ok sorry for asking so many questions just kind of new and not understanding i will try.
#9
ok i finally got it but now i add another macro and when i want that macro to run it will run Minimize QM and the second macro is Help which runs to the qm forum? help
#10
If you have 2 buttons, add similar code for each of them. Example:

...
,case 3
,mac "macro1"
,case 4
,mac "macro2"
#11
i tried it and it said case without sel. in the qm output i am putting this in the function that shows the dialog correct?
#12
Nevermind I finally figured out ty for your help Gin appriciate it!


Forum Jump:


Users browsing this thread: 1 Guest(s)