Tag GodLikerz & Coderz
Ich zeige euch jetzt mal wie das HotKeySet funktioniert.:wink:
Nehmen wir mal zum Beispiel einen leeren Gui Script:
Alles anzeigen
Langweiliges Script oder? xD
Dient ja nur als Beispiel
So nun bauen wir mal als HotKeySet ein, das wenn man ESCAPE drückt sich das programm beendet.
Alles anzeigen
Hmm wie wärs bauen wir noch eine MsgBox Funktion ein? Na Klar doch!
Alles anzeigen
So viel Spass damit, Hofe ich kann helfen
MFG xDrago
Ich zeige euch jetzt mal wie das HotKeySet funktioniert.:wink:
Nehmen wir mal zum Beispiel einen leeren Gui Script:
Quellcode
Langweiliges Script oder? xD
Dient ja nur als Beispiel
So nun bauen wir mal als HotKeySet ein, das wenn man ESCAPE drückt sich das programm beendet.
Quellcode
- #include <GUIConstants.au3>
- HotKeySet("{Esc}", "_Exit") ;Hier der HotKey...
- #Region ### START Koda GUI section ### Form=
- $Form1 = GUICreate("Form1", 624, 444, 193, 125)
- GUISetState(@SW_SHOW)
- #EndRegion ### END Koda GUI section ###
- Func _Exit ;Anfang der Funktion.
- Exit ;Beendet das Programm.
- Endfunc ;Ende der Funktion.
- While 1
- $nMsg = GUIGetMsg()
- Switch $nMsg
- Case $GUI_EVENT_CLOSE
- Exit
- EndSwitch
- WEnd
Hmm wie wärs bauen wir noch eine MsgBox Funktion ein? Na Klar doch!
Quellcode
- #include <GUIConstants.au3>
- HotKeySet("{Esc}", "_Exit") ;Hier der HotKey... Wenn man Escape drückt.
- HotKeySet("{F1}", "_F1") ;Hier der HotKey... Wenn man F1 drückt.
- #Region ### START Koda GUI section ### Form=
- $Form1 = GUICreate("Form1", 624, 444, 193, 125)
- GUISetState(@SW_SHOW)
- #EndRegion ### END Koda GUI section ###
- Func _Exit ;Anfang der Funktion.
- Exit ;Beendet das Programm.
- Endfunc ;Ende der Funktion.
- Func _F1 ;Anfang der Funktion.
- MsgBox(0, "Info", "Du hast es geschafft eine MsgBox zu öffnen!, Herzlichen Glückwunsch.") ;Beendet das Programm.
- Endfunc ;Ende der Funktion.
- While 1
- $nMsg = GUIGetMsg()
- Switch $nMsg
- Case $GUI_EVENT_CLOSE
- Exit
- EndSwitch
- WEnd
So viel Spass damit, Hofe ich kann helfen
MFG xDrago