Jump to content

Blocking User Mouse Input yet being able to use MouseClick()

Recommended Posts

I am stuck. I am trying to block the users from using the mouse yet in this script I need to make extensive use of Mouseclick()

I am using BlockInputEx to block the mouse but it also blocks MouseClick(). I can unblock the mouse long enough to do a MouseClick() and then re-block it but the users have found out that in the brief moment between un-blocking and re-blocking they have control of the mouse. Any ideas?

Link to post
Share on other sites

Make the mouseclicks instant? You should be able to unblock, instant click, then re block.


Do you have #requireadmin ? If so, you should be able to do mouse clicks with the blockinput enabled.

Edited by Kidney
Link to post
Share on other sites

That seems to be the problem. Out of all the threads I have started about BlockInputEx I have gotten absolutely zero replies. After first looking at BlockInputEx my first thought was "what a wonder udf". After months of no replies either in the General area or in the BlockInputEx thread I am getting a bad feeling that no one uses it and it is obsolete. Has it been replaced with something "new and improved"?

Link to post
Share on other sites

I think blocking keyboard or mouse isn't the best way to keep users from doing "bad" things. You mentioned the application you want to control to be a "commercial package".

I would suggest to give your users only permissions they need to have. So your "control script" should become obsolete.

My UDFs and Tutorials:


Active Directory (NEW 2021-06-05 - Version - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2021-06-14 - Version - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version - Download
Outlook Tools (2019-07-22 - Version - Download - General Help & Support - Wiki
ExcelChart (2017-07-21 - Version - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
Task Scheduler (2019-12-03 - Version - Download - General Help & Support - Wiki

ADO - Wiki, WebDriver - Wiki


Link to post
Share on other sites
  • Moderators


I chided you gently here about the number of threads you have opened on this topic and now I find you have started yet another. :)

If no-one is answering it is because no-one knows the solution or no-one is interested enough to work on it. Remember that what is important to you is not necessarily so to others - and also that you paid nothing to use AutoIt or to post here, so no-one here has any obligation to offer you any help at all.

I will make myself absolutely clear this time - do NOT open another thread on this subject or you will not be able to open any threads at all for a while. ;)


Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:


ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area


Link to post
Share on other sites

Search for MouseSetOnEvent_UDF.au3.

Here is an example of stopping mouse movement for 8 seconds

#include "MouseSetOnEvent_UDF.au3"

;Disable mouse moves, and call our function when mouse would have moved
_MouseSetOnEvent($MOUSE_MOVE_EVENT, "MouseMove_Event")
_MouseSetOnEvent($MOUSE_MOVE_EVENT) ;Enable mouse move again.

;more code?

Func MouseMove_Event()

The mouse event udf is

Edited by martin
Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to post
Share on other sites
  • 2 weeks later...

May I suggest only disabling controls (buttons, input boxes etc) and not disabling all user input. If for some reason the script hangs or goes into an infinite loop during this, the user is unable to do anything. Of course you can just hit ctrl+alt+del and it will free the controls back up, but if we're talking about a true "User", they wouldn't know to do that.


“Hello, ladies, look at your man, now back to me, now back at your man, now back to me. Sadly, he isn’t me, but if he stopped using ladies scented body wash and switched to Old Spice, he could smell like he’s me. Look down, back up, where are you? You’re on a boat with the man your man could smell like. What’s in your hand, back at me. I have it, it’s an oyster with two tickets to that thing you love. Look again, the tickets are now diamonds. Anything is possible when your man smells like Old Spice and not a lady. I’m on a horse.”


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
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...