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.
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.
The question is... Why use mouseclick? Is the program configured in such a way that you cannot use ControlClick to do the same thing?