Ich habe ein problem mit dem start stop knopf + wenn ich auf start gedrückt habe funktioniert das Programm aber so bald ich stop drücke oder versuche die Gui zu schließen geht das nicht
C
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("SchlafMoon", 356, 133, 208, 161)
GUISetBkColor(0x000000)
$Label1 = GUICtrlCreateLabel("create by SchlafMoon", 0, 112, 202, 20)
GUICtrlSetFont(-1, 8, 800, 2, "MV Boli")
GUICtrlSetColor(-1, 0xFFFFFF)
$Start = GUICtrlCreateButton("On", 24, 40, 115, 57)
GUICtrlSetFont(-1, 11, 800, 2, "MV Boli")
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetBkColor(-1, 0x008000)
$Stop = GUICtrlCreateButton("Off", 195, 39, 115, 57)
GUICtrlSetFont(-1, 11, 800, 2, "MV Boli")
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetBkColor(-1, 0xFF0000)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Start
starten()
Sleep(1000)
Case $Stop
pause()
Sleep(1000)
EndSwitch
WEnd
Func starten()
While 1
sleep(100)
Controlsend("","","", "{space}")
Controlsend("","","", "{x}")
Controlsend("","","", "{9}")
WEnd
Endfunc
Func pause()
While True
Sleep(1000)
WEnd
Endfunc
Alles anzeigen