Misomaniac Posted November 18, 2017 Share Posted November 18, 2017 Hey i am new in AutoIT. I am searching a Way to send a letter that is linked to a hotkey. Its possible? I made a little GUI but it doesnt work. ESC=Exit c=Show Message Box or if the Checkbox isnt active send "c" Greetz Test-c.au3 Link to comment Share on other sites More sharing options...
Misomaniac Posted November 18, 2017 Author Share Posted November 18, 2017 (edited) You dont need to download the Script. I will show it here: #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <MsgBoxConstants.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 406, 308, 261, 200) $testbox = GUICtrlCreateCheckbox("Testbox", 136, 104, 97, 17) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### HotKeySet("c", "_Config") HotKeySet("{ESC}", "_Beenden") While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Func _Config() If GUICtrlRead($testbox) = 1 Then MsgBox($MB_SYSTEMMODAL, "Title", "The Checkbox is active.", 3) Else Send ("c") EndIf EndFunc Func _Beenden() Exit EndFunc Edited November 18, 2017 by Jos added codebox Link to comment Share on other sites More sharing options...
Developers Jos Posted November 18, 2017 Developers Share Posted November 18, 2017 (edited) what exactly is not working? I guess you do have to disable the hotkey before sending the actual character like: Func _Config() If GUICtrlRead($testbox) = 1 Then MsgBox($MB_SYSTEMMODAL, "Title", "The Checkbox is active.", 3) Else HotKeySet("c") Send ("c") HotKeySet("c", "_Config") EndIf EndFunc Jos Ps: Using codeboxes is a little easier to read. Edited November 18, 2017 by Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Misomaniac Posted November 18, 2017 Author Share Posted November 18, 2017 Yes that was my mistake Thank you! Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted November 18, 2017 Moderators Share Posted November 18, 2017 Moved to the appropriate forum, as the Dev forum very clearly states: Quote Do not create AutoIt-related topics here, use AutoIt General Help and Support "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now