Aro2220 Posted March 20, 2010 Posted March 20, 2010 (edited) Hi! I have a script that simulates mouse clicks and key strokes to automate tasks so I can use a hotkey to do them quicker. The problem is that when these scripts are running if the user hits a button on the keyboard or clicks the mouse it will do things that the script wasn't prepared for. I have heard of the function BlockInput but I can't get it to work. I don't know if I have to include some kind of library (http://msdn.microsoft.com/en-us/library/ms646290%28VS.85%29.aspx) to get it to work in an autoit script but the pseudoscript below won't work for me (it functions the same as if the blockinput line was commented) BlockInput(1) ;user should be unable to use the keyboard/mouse Send("hello world") Sleep (2000) Send("is anyone there?") BlockInput(0) ;user should now be able to use the keyboard/mouse Sleep (2500) Send("OH MY GOSH") additionally, I run Windows 7 64 Edited March 20, 2010 by Aro2220
i542 Posted March 20, 2010 Posted March 20, 2010 That's odd. It works perfectly with me. It might be a bug in Windows 7. Try adding #RequireAdmin on start of your script. I can do signature me.
gaucho14 Posted March 20, 2010 Posted March 20, 2010 work fines for me to. i running windows xp if it matter.
Aro2220 Posted March 24, 2010 Author Posted March 24, 2010 That's odd. It works perfectly with me. It might be a bug in Windows 7. Try adding #RequireAdmin on start of your script.Thanks! #RequireAdmin was the problem. Windows 7 and I assume Vista probably block this function without that UAC box thing. Windows XP never had this feature so this makes sense.
Guest Posted March 23, 2012 Posted March 23, 2012 Just wondering if this would work with out admin rights as a need to run it on a network where my rights = 0
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