Disable mouse and keyboard while Winbatch does mouse movements and clicks

Started by edmoran, February 10, 2015, 09:29:29 AM

Previous topic - Next topic

edmoran

I want to disable the users keyboard and mouse while my program does multiple mouse movements, mouse clicks, and sendkeys.  What is the best way to accomplish that?

Ed Moran


td

If you use IgnoreInput to disable input, the SendKey* and MouseMove functions temporarily re-enable input while they are performer their respective task and disable it again when they are done.
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

td

In the above reply I inadvertently used the term 'EnableInput' instead of 'IgnoreInput' when referring to the WinBatch function that temporarily blocks UI input.  I have since corrected the post and apologize for any confusion the typo may have caused.

Note that user input is automagically enabled when a blocking WinBatch script terminates, if the blocking script does not called 'IngoreInput(@false)'.  It will also be re-enable when blocked, if a user presses the CTRL+ALT+DEL key sequence.
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade