OregonJohn Posted September 4, 2012 Share Posted September 4, 2012 By accident I discovered that ctrl-break not only stops a script being written and tested with tools/go, but even the compiled script is affected. I tried this on a variety of script and always got the same results. ctrl-break is used so seldom by normal users that it is probably not a big deal, but it is a nuisance. I would like to stop ctrl-break from acting on my compiled scripts. I tried the following from the help file "GuiCreate" example and ctrl-break stops the compiled version: #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Example1() ; example 1 Func Example1() Local $msg GUICreate("My GUI") ; will create a dialog box that when displayed is centered GUISetState(@SW_SHOW) ; will display an empty dialog box ; Run the GUI until the dialog is closed While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop WEnd GUIDelete() EndFunc ;==>Example1 I tried Break(0) ;Disable break But that didn't seem to work. Anyone have an idea on how to stop ctrl-break from stopping my compiled script? Link to comment Share on other sites More sharing options...
bogQ Posted September 4, 2012 Share Posted September 4, 2012 (edited) you can try to go around it with something similar to If $msg = $GUI_EVENT_CLOSE And _IsPressed(11)+_IsPressed(13) <> 2 Then ExitLoop Edited September 4, 2012 by bogQ TCP server and client - Learning about TCP servers and clients connectionAu3 oIrrlicht - Irrlicht projectAu3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related) There are those that believe that the perfect heist lies in the preparation.Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost. Link to comment Share on other sites More sharing options...
rover Posted September 4, 2012 Share Posted September 4, 2012 Opt("GUICloseOnESC", 0) I see fascists... Link to comment Share on other sites More sharing options...
OregonJohn Posted September 6, 2012 Author Share Posted September 6, 2012 Thanks to both of you, BogQ and Rover. Opt("GUICloseOnESC", 0) worked, funny how it worked on Break as well as ESC. I didn't try the other, went for simple. thanks again. John. 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