Posts: 576
 
	
	
		hello, i need help with a dialog...
i cannot understand how the check pushlike button starts a macro, then wen it is pressed again, it comes up and stops the macro...i know its possible cannot get it to work tho 
plz help
thnxx
	
 
 
	
	
	
		
	Posts: 473
 
	
	
		
	
	
Taking  on  Quick  Macros  one  day  at  a  time 
	
	
 
 
	
	
	
		
	Posts: 473
 
	
	
		
	
Attached Files QM Expert.qml  (Size: 1.03 KB / Downloads: 746)
 
	
Taking  on  Quick  Macros  one  day  at  a  time 
	
	
 
 
	
	
	
		
	Posts: 12,239
 
	
	
		Example
Function dialog_check_start_stop_macro
\Dialog_Editor function # hDlg message wParam lParamif (hDlg) goto  messagesstr  controls = "3"str  c3Staif (!ShowDialog ("dialog_check_start_stop_macro" &dialog_check_start_stop_macro  &controls)) ret ;BEGIN DIALOG ret ;messages sel  message, case  WM_INITDIALOG , case  WM_DESTROY , case  WM_COMMAND  goto  messages2ret ;messages2 sel  wParam, case  3, if (but (lParam)) ;;checked ,, mac  "Macro508",, _s="Stop", else  ;;unchecked ,, shutdown  -6 0 "Macro508",, _s="Start", _s.setwintext(lParam), case  IDOK , case  IDCANCEL ret  1
 
 
	
	
	
		
	Posts: 576
 
	
	
		thanks gint that was perfect
	
	
	
	
	
 
 
	
	
	
		
	Posts: 129
 
	
	
		I've tried the code above and the macro only ran once.  I tried a function and did the same thing.  There is no ret or end code in either of them.
	
	
	
	
 
 
	
	
	
		
	Posts: 12,239
 
	
	
		This code can be used only to start/stop single macro or function. For multiple functions, you need two simple buttons - Start and Stop.
	
	
	
	
	
 
 
	
	
	
		
	Posts: 129
 
	
	
		Hi Gintaras:
	
	
	
	
 
 
	
	
	
		
	Posts: 576
 
	
	
		What do you mean by run more then once?
	
	
	
	
	
 
 
	
	
	
		
	Posts: 129
 
	
	
		The file you provided didn't even do what you said it would.
	
	
	
	
 
 
	
	
	
		
	Posts: 12,239
 
	
	
		this is with 2 simple buttons
Function 
dialog_start_stop_macro  \Dialog_Editor function #  hDlg message wParam lParamif ( hDlg)  goto  messagesif ( ! ShowDialog ( "dialog_start_stop_macro"  & dialog_start_stop_macro  0 ))  ret ;BEGIN DIALOG ;0 "" 0x90C80AC4 0x108 0 0 111 24 "Dialog" ;3 Button 0x54032000 0x0 6 6 48 14 "Start" ;4 Button 0x54032000 0x0 58 6 48 14 "Stop" ;END DIALOG ;DIALOG EDITOR: "" 0x2030006 "" "" "" ret ;messages sel  message, case  WM_INITDIALOG , case  WM_DESTROY , case  WM_COMMAND  goto  messages2ret ;messages2 sel  wParam, case  3 , mac  "Function75" , , case  4 , shutdown  - 6  0  "Function75" , , case  IDOK , case  IDCANCEL ret  1 
 
 
	
	
	
		
	Posts: 576
 
	
	
		Press Start, it will start a macro, press stop it will stop it.
you can do it as many times as you want.
Function 
Function7  \Dialog_Editor function #  hDlg message wParam lParamif ( hDlg)  goto  messagesstr  controls =  "3" str  c3Staif ( ! ShowDialog ( "Function7"  & Function7  & controls))  ret ;BEGIN DIALOG ;0 "" 0x90C80AC4 0x108 0 0 59 24 "Dialog" ;3 Button 0x54013003 0x0 6 6 48 14 "Start" ;END DIALOG ;DIALOG EDITOR: "" 0x2020100 "" "" ret ;messages sel  message, case  WM_INITDIALOG , case  WM_DESTROY , case  WM_COMMAND  goto  messages2ret ;messages2 sel  wParam, case  3 , if ( but ( lParam))  ;;checked ,, mac  "Function57" ,, _s= "Stop" , else  ;;unchecked ,, shutdown  - 6  0  "Function57" ,, _s= "Start" , _s.setwintext( lParam) , case  IDOK , case  IDCANCEL ret  1 
 
 
	
	
	
		
	Posts: 28
 
	
	
		Denise, all the post was about was check pushlike, in order to make a function or macro repeat, you can use a few diffrent methods, click on the help section of your qm or search the site for rep. hope this helps!