hi
I need some help.
I'm trying to get this to work, but everything seems to fail.
This is what I have:
1) a button ("Start (F8)")
2) a hotkey ("{F8}")
3) Opt("GUIOnEventMode", 1)
I can't use a msg loop cause of blocking functions!
HotKeySet("{F8}", "togglePause")
$btnStart = GUICtrlCreateButton("Start (F8)", 217, 101, 135, 44, $WS_GROUP)
GUICtrlSetFont(-1, 14, 800, 0, "Verdana")
GUICtrlSetOnEvent(-1, "togglePause")
Func togglePause()
$paused = Not $paused
If ($paused) Then
GUICtrlSetData($btnStart, "Start (F8)")
EndIf
While $paused
Sleep(50)
WEnd
GUICtrlSetData($btnStart, "Stop (F8)")
EndFunc
If I click Start/Stop twice then every button stops responding, I can't close the form etc.
Using the Hotkey I have no problems.
I don't understand why this isn't working, is there a way to get this working without a msgloop?