Jump to content

Exclude Hotkeys from Block Input


Rishav
 Share

Recommended Posts

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)
Link to comment
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.

Edited by Inverted
Link to comment
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.

Link to comment
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

Link to comment
Share on other sites

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
Link to comment
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.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...