xJilo Posted September 14, 2020 Share Posted September 14, 2020 Hi, Can I ask someone for a help for my project I know how to put hotkey with this: #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form= $PicT = GUICreate("Keyboard", 1001, 414, 60, 0) $Pic1 = GUICtrlCreatePic("C:\Users\JiLO\Desktop\Dokio Credentials\Keyboard-Project\Samle-3.jpg", -24, -104, 1225, 681, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS)) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit WinWaitActive("Keyboard") WinClose("Keyboard") EndSwitch WEnd But I can't close it or easily terminate it with the same hotkey. Can someone help me solving this problem? Link to comment Share on other sites More sharing options...
Dan_555 Posted September 14, 2020 Share Posted September 14, 2020 (edited) If you want to end the running autoit script with a hotkey, then you can do it like this, use ctrl q to quit: If HotKeySet("^q", "exitapp") = 0 Then MsgBox(0, "Hotkey", "Err: Could not set. ") local $oldsec=@sec While 1 if $oldsec<>@sec then ConsoleWrite(@hour & ":" & @MIN & ":" & @sec & @crlf) $oldsec=@sec EndIf WEnd Func exitapp() exit EndFunc Btw, you can remove the two lines: Quote WinWaitActive("Keyboard") WinClose("Keyboard") because they are after the exit, they never get executed. Edited September 14, 2020 by Dan_555 xJilo 1 Some of my script sourcecode Link to comment Share on other sites More sharing options...
Developers Jos Posted September 14, 2020 Developers Share Posted September 14, 2020 Moved to the appropriate forum, as the AutoIt Example Scripts forum very clearly states: Quote Share your cool AutoIt scripts, UDFs and applications with others. Do not post general support questions here, instead use the AutoIt Help and Support forums. Moderation Team 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...
xJilo Posted September 15, 2020 Author Share Posted September 15, 2020 Thanks Done it's solved my problem using different way. 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