Rishav Posted September 8, 2009 Posted September 8, 2009 Hi there purdy folks question. I have a script during which i don't want anyone to get their grubby paws onto my system. So BlockInput seemed like a good idea. But Now if i want to pause/close my script in mid execution, I can't. I would like to have "Pause|Break" as the key which opens a simple while do function and CTRL + "Pause|Break" to kill the script altogether. Any ideas? BlockInput(1) $Email_gui = GUICreate("Best GUI in the universe!", 600, 250, -1, -1, 0) GUISetState(@SW_SHOW) $Email_gui_ani = GUICtrlCreateAvi(@SystemDir & "\shell32.dll", 170, 150, 30) GUICtrlSetState($Email_gui_ani, 1) $Email_gui_label = GUICtrlCreateLabel("Its awesomeness is UNPARALLED!!", 60, 150, 500) GUICtrlSetFont($Email_gui_label, 13, 900, 0, "Times New Roman") sleep(5000) GUIDelete($Email_gui) BlockInput(0)
Inverted Posted September 8, 2009 Posted September 8, 2009 (edited) First of all, if you press ctrl+alt+del, you can get out of BlockInput , right ? Anyway, you can set a global key hook (SetWindowsHookEx) and then you get notified about all keys, so you can ignore all (and not pass them to the next program) except the magic one. In this case you don't need HotKeySet or BlockInput. Edited September 8, 2009 by Inverted
Rishav Posted September 8, 2009 Author Posted September 8, 2009 First of all, if you press ctrl+alt+del, you can get out of BlockInput , right ?Anyway, you can set a global key hook (SetWindowsHookEx) and then you get notified about all keys, so you can ignore all (and not pass them to the next program) except the magic one. In this case you don't need HotKeySet or BlockInput.Sounds interesting. Imma gonna research it up. Thanks.
jvanegmond Posted September 8, 2009 Posted September 8, 2009 You can set a password for your windows user account and press Win+L if you walk away from the PC. You can also set your screensaver to ask for your password when someone tries to close the screensaver. github.com/jvanegmond
Rishav Posted September 11, 2009 Author Posted September 11, 2009 not really Mana. The idea was to start the automation and while the automation runs, the system is untouchable. But since in several places i do use send and other such windows dependant commands, simply locking the desktop may not work.
jvanegmond Posted September 11, 2009 Posted September 11, 2009 You're probably right. This business is a bit tricky. Inverted has some good ideas how to deal with them. Here's the "SetWindowsHookEx" function he is talking about in a AutoIt script: http://www.autoitscript.com/forum/index.php?showtopic=55694 github.com/jvanegmond
Rishav Posted September 11, 2009 Author Posted September 11, 2009 (edited) Yeah it is an intriguing idea but after suffering a panic attack after reading the example file and thinking up the effort required to make it work, i decided to go for a more humanist approach. I have now put up a paper sign saying; "TOUCH MA SYSTEM AND I KEEL YOU!", with some dismembered stick figures drown below it. crude and extremly effective. Works just as good. Edited September 11, 2009 by Rishav
jvanegmond Posted September 11, 2009 Posted September 11, 2009 Although I agree that it is complicated. I have written somewhat of a wrapper to simplify the approach of using this "as a hotkey" (with a twist): http://www.autoitscript.com/forum/index.php?showtopic=68422 In the past I have also written admin scripts, and there I showed a GUI too with the company logo and a big message below which is similar to yours. github.com/jvanegmond
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