Sign in to follow this  
Followers 0
Rishav

Exclude Hotkeys from Block Input

8 posts in this topic

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? :D

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)

Share this post


Link to post
Share on other sites



#2 ·  Posted (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 by Inverted

Share this post


Link to post
Share on other sites

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. :D

Thanks.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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. :D

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

#7 ·  Posted (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. :D

Edited by Rishav

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0