Hey,
How can you stop an function while running that function? Like this:
#include <GuiConstants.au3>
GuiCreate("Example")
$button = GuiCtrlCreateButton("Click Me", 10, 10, 200, 200)
GuiSetState(@SW_SHOW)
While 1
$msg = GuiGetMsg()
If $msg = $GUI_EVENT_CLOSE Then Exit
If $msg = $button Then oops_Function_That_Forgets_To_Check_GuiGetMsg()
WEnd
Func oops_Function_That_Forgets_To_Check_GuiGetMsg()
While 1
sleep(100)
WEnd
EndFunc