Jump to content
Sign in to follow this  
JERPVTX

ControlClick ID

Recommended Posts

JERPVTX

I am trying to click on several different buttons on an application.  I have used the AU3 window info to successfully click almost all of the buttons.  There is one that is giving me a hard time, refer to attached images.  The first one (image1) shows the details of the "Open All" button.  I used the following script to successfully click that button : 

ControlClick($hWnd, "", "[CLASS:Button; INSTANCE:92]")

For the second image I altered that command to:

ControlClick($hWnd, "", "[CLASS:Button; INSTANCE:79]") But it does not work.  Notice that with the Open button, only the actual Open button is highlighted, but with the Close button both of the buttons are highlighted.  This is a program that I believe was written and compiled in C# so I have no way of getting into the source code.  

I started playing around with relative positions since I know the position of the Open button, I figured I could offset from there to get to the close button but I haven't figured that out yet either.  

 

Any help would be greatly appreciated!!!

 

image1.jpg

image2.jpg

Share this post


Link to post
Share on other sites
JERPVTX

Danp2,

Yeah, it looks like that doesn't it.  However when I move the AU3 target over the Open button, the Open button gets outlined.  When I move the AU3 target over the Close button, the whole group gets outlined.  I have no choice, that is what it picks.  However, I did write a work around using coordinates. Here's a excerpt of my code to move the mouse:

   Local $aPosition = ControlGetPos($hWnd, "", "[CLASS:Button; INSTANCE:92]") ;get position of Open button
   Local $aNewPosition[2]

   opt("MouseCoordMode", 2); set to relative coordinate mode

   $aNewPosition[0] = $aPosition[0] + 0.5*$aPosition[2]; Offset x position to center of Close button
   $aNewPosition[1] = $aPosition[1] + 1.5*$aPosition[3]; Offset y position to center of Close button
   MouseMove($aNewPosition[0], $aNewPosition[1])

I would very much like to avoid using the MouseMove command if anyone has a solution the the original problem.

Share this post


Link to post
Share on other sites
Earthshine

Looking into spy utilities

 

Edited by Earthshine

My resources are limited. You must ask the right questions

 

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.