HotKeySet("{F2}", "MSG")
HotKeySet("{F3}", "xt")
Global $chk
Func _DoStuff($lab, $val)
If $chk = 0 Then Return (-1)
MsgBox(0, $lab, $val)
If $chk = 0 Then Return (-1)
EndFunc ;==>_DoStuff
Func MSG()
$chk = 1
While 1
If _DoStuff("TEST", "1") = -1 Then ExitLoop
If _DoStuff("TEST", "2") = -1 Then ExitLoop
If _DoStuff("TEST", "3") = -1 Then ExitLoop
If _DoStuff("TEST", "4") = -1 Then ExitLoop
If _DoStuff("TEST", "5") = -1 Then ExitLoop
$chk = 0
WEnd
EndFunc ;==>MSG
Func xt()
$chk = 0
EndFunc ;==>xt
While 1
Sleep(200)
WEnd
HotKeySet("{F2}", "MSG")
HotKeySet("{F3}", "xt")
Func MSG()
$chk = 1
while 1
MsgBox(0, "TEST", "1")
MsgBox(0, "TEST", "2")
MsgBox(0, "TEST", "3")
MsgBox(0, "TEST", "4")
MsgBox(0, "TEST", "5")
$chk = 0
wend
EndFunc ;==>MSG
Func xt()
_main()
EndFunc ;==>xt
_main()
Func _main()
While 1
Sleep(200)
WEnd
EndFunc