#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
Opt("GUIOnEventMode", 1)
Global $gInfiniteLoop = false
#Region ### START Koda GUI section ### Form=C:\Dokumente und Einstellungen\****\Desktop\Form1.kxf
$Form1 = GUICreate("Test", 500, 180, 300, 300)
GUISetIcon("C:\test.jpg")
GUISetOnEvent($GUI_EVENT_CLOSE, "Form1Close")
GUISetOnEvent($GUI_EVENT_MINIMIZE, "Form1Minimize")
GUISetOnEvent($GUI_EVENT_MAXIMIZE, "Form1Maximize")
GUISetOnEvent($GUI_EVENT_RESTORE, "Form1Restore")
$Button1 = GUICtrlCreateButton("Start", 10, 66, 235, 72, 0)
GUICtrlSetFont(-1, 30, 400, 0, "Arial Black")
GUICtrlSetOnEvent(-1, "StartClick")
$Button2 = GUICtrlCreateButton("Stop", 255, 66, 235, 72, 0)
GUICtrlSetFont(-1, 30, 400, 0, "Arial Black")
GUICtrlSetOnEvent(-1, "StopClick")
$Button3 = GUICtrlCreateButton("Exit", 10, 144, 480, 31, 0)
GUICtrlSetFont(-1, 10, 400, 0, "Arial Black")
GUICtrlSetOnEvent(-1, "ExitClick")
$Beschreibung = GUICtrlCreateLabel("test.", 15, 11, 472, 17)
$Beschreibung2 = GUICtrlCreateLabel("test.", 15, 40, 472, 17)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While Sleep(10)
    If $gInfiniteLoop Then
	   While $gInfiniteLoop
            Send ("{F11}")
			Send ("{F11}")
			Send ("{ENTER}")
			Sleep (100)
        WEnd
    EndIf
WEnd
Func StartClick()
    $gInfiniteLoop = true
EndFunc
Func StopClick()
    $gInfiniteLoop = False
EndFunc
Func ExitClick()
    Exit
EndFunc
Func Form1Close()
    Exit
EndFunc
Func Form1Maximize()
EndFunc
Func Form1Minimize()
EndFunc
Func Form1Restore()
EndFunc