Jump to content

Multiple programs call for the mouse


 Share

Recommended Posts

I'm trying to run multiple programs, each oh which uses mouseclick at different locations. What happens if they call for the mouse at the same time? Does one get it first and the other one has to wait or do they both continue assuming that the mouse did what it was told to while only one actually does? Merging the programs is not an option so I really need to know what happens in this situation. Thank you for your time.

Link to comment
Share on other sites

I'm trying to run multiple programs, each oh which uses mouseclick at different locations. What happens if they call for the mouse at the same time? Does one get it first and the other one has to wait or do they both continue assuming that the mouse did what it was told to while only one actually does? Merging the programs is not an option so I really need to know what happens in this situation. Thank you for your time.

Link to comment
Share on other sites

  • Developers

You even posted the topic twice. ;)

Have you tried what happens? My guess is that you have one mouse and the separate scripts will be fighting for control. 
Care to explain why one script is no option? What are you trying to automate?

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

I faced the similar issue earlier as the user launching two separete autoit automation exe files on the same machine same time.

May be it is not the correct approach, but I followed the below one.

Whenever an application trying to access the mouse control, I am checking for a file/registry and wait for till it's get deleted.
If not there, it will create them and enter the execution.

So I am using the registry/file as a lock for entering the mouse control and deletes it once the execution is completed.
 

Other scripts also I implemented the same logic.

Link to comment
Share on other sites

22 hours ago, Funtime60 said:

they both continue assuming that the mouse did what it was told to while only one actually does

 

1 hour ago, ur said:

using the registry/file as a lock

1 hour ago, ur said:

it is not the correct approach

Using a mutex would be a more appropriate approach, see here and here.

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