Jump to content
Sign in to follow this  

WinActivate() and MouseClick() Issues With PixelCoordMode

Recommended Posts

Hi guys,

I've been looking through the forums trying to find anything similar to what I've been trying to deal with, but I haven't been able to find anything useful.

I'm working on an autoit script that monitors the output of one web report, and depending on what that says, it will click a button on a program that I've setup to record when the changes occur. I have to run one program per log file (both autoit and my recorder), so I sometimes run 2 or 3 at a time. For the most part this setup works well.

However, sometimes WinActivate() seems to occur from program #1 while MouseClick is in process from program #2 after its own WinActivate() call.

The WinActivate() call and MouseClick() call with both complete fine for the (first) original effort to click a coordinate on the target window.

However, once that second WinActivate() call happens, immediately after clicking the original target, the cursor goes immediately up to the same coordinates on the newly activated window. My thinking is that the impeding WinActivate() call confuses MouseCoordMode movements, and then causes it to switch?

It doesn't seem to click on the coordinates it's sent to mistakenly, but it's just a bit of a pain to deal with.

My PixelCoordMode and MouseCoordMode lines are:

AutoItSetOption ( "PixelCoordMode", 0 )

AutoItSetOption ( "MouseCoordMode", 0 )

If this behavior is something that I can't easily change, then I guess my only option will be to check the window position with each loop iteration and switch to absolute pixel coordinates. I'd hate to have to do that since it's just more work, but if I have to, then I have to.

Any help will be greatly appreciated!

Thank you!

Share this post

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
Sign in to follow this  

  • Create New...