Jump to content
Sign in to follow this  
cabrunco

ControlClick only works for active window

Recommended Posts

cabrunco

Dear all, please see the following code:

opt("WinTitleMatchMode",1)

ControlClick("Warning","","Button1")

 

This is supposed to work when the "Warning" window is on the background. In fact, it always does except when I have the Mach3 software for CNC control working at the same time. Now, if I do the following, it works even with the Mach3 software active:

 

opt("WinTitleMatchMode",1)
WinActivate("Warning")
ControlClick("Warning","","Button1")

 

Any possible reason for that? Not very important, I have no problems making the "Warning" window being active, but still it looks strange to me. Oh, and using the advanced mode, like below, does not help:

 

ControlClick("[CLASS:#32770]; Title:Warning","","[CLASS:Button; INSTANCE:1]")

 

Thank you for any help,

Cabrunco

Share this post


Link to post
Share on other sites
232showtime

what apps/programs are you trying to automate? kindly post your script.

Edited by 232showtime

ill get to that... i still need to learn and understand a lot of codes graduated.gif

Correct answer, learn to walk before you take on that marathon.

Share this post


Link to post
Share on other sites
cabrunco

It is a program I wrote myself on AutoIt (the GUI). It only does simple things, like sending messages like "Are you ready?" or "Waiting", "Warning", and changes some fields to "Done", "Measuring", etc. Nothing special, I am really just trying to learn about autoit. Enough detail, or do you need more info? I tested again here after closing Mach3, and it is not working anymore even with it closed.

As I said, it is not a very big deal, but it used to work before. I am using Windows 8. Maybe I did not do the advanced mode right...

Share this post


Link to post
Share on other sites
cabrunco

I think I just understood what happened. It works, but it clicks and just selects the button. I need to click again, and then it works properly. In other words, I send the ControlClick twice. Good enough for me. Cheers!

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  

×