Sign in to follow this  
Followers 0
Guest surfbum3000

mouse click on button failing

3 posts in this topic

I want to log on to an app, open a query file, and run the query. I am able to log on to the app. and then open a secondary window with Title: Query Definition that includes 4 buttons: Table Selector, Open Query Definition, Save Query Definition, and New Query. I want to click on the 2nd button from the left that opens a query definition file, but the 1st button Table Selector on the far left keeps being selected. The ClassNameNN is DFDialogClass2 where the 4 buttons are located. There is no Text and no Control ID. I have tried the following that have failed:

MouseClick ("left", 616, 108, 1)

ControlClick ( "", "", "DFDialogClass2")

PixelSearch ( 0, 0, 0, 0, 0xFFFFFF)

Here is the script so far. I have the window active "Query Definition" that I need to click the button on, but the mouse click after WinWaitActive is what is failing:

Run("\\network\folder\launch.exe")

WinWaitActive("Primary Window Name")

Send("!q")

Send("Query")

WinWaitActive("Query Definition")

Share this post


Link to post
Share on other sites



Are those Screen/Coord/Window Coordinates for you mouseclick?

Opt("MouseCoordMode", 0) ; For Window

Opt("MouseCoordMode", 1) ; For Screen

Opt("MouseCoordMode", 2) ; For Client

Try Which every way you got your coords posting that at the top of your script. (only 1 of them :whistle: )


Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Share this post


Link to post
Share on other sites

Another option to try to is use the AutoItInfo screen and then select (don't click) the button you want clicked. Sometimes you will get a control and text to appear which were hidden before. This has happened to me several times.

In that case, I would recommend doing a ControlFocus() and then a ControlClick() afterwards. Or even ControlGetText() and doing a Select/Case or If/Then statement to verify it is the correct button.

I hope this made sense and helps you on your way to a workable script.

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  
Followers 0