it works fine but when i add a gui and i put the hotkeyset above the gui i get the error again. HotKeySet("!x", "ExitProg")
HotKeySet("!s", "StartStop");Shift+s
GuiCreate("Program",218,68,332,219)
$label1=GuiCtrlCreateLabel("Alt+S",9,30,141,15)
$label2=GuiCtrlCreateLabel("Alt+X",115,30,105,15)
$label3=GuiCtrlCreateLabel("By Harusal",166,55,55,15)
GuiSetState()
While 1
$msg=GuiGetMsg()
If $msg=-3 Then Exit
Wend
Func ExitProg()
Exit 0;;Exits the program
EndFunc
Dim $On
$On = False
While 1
While $On = True
;;Do Code
WEnd
Sleep(100)
WEnd
Func StartStop()
If $On = False Then
$On = True
Else
$On = False
EndIf
EndFunc