Jump to content

To get all the coordinates of a window


 Share

Recommended Posts

Hi All,

I am quite an intermediate in using AUTOIT and i am using it to automate one of our application.

From past two months i am working on AUTOIT, Right now i am using the mouse coordinates to move to the certain point in the GUI and then click on the same.

The question i am stuck with is, Instead of using mouse coordinates I want store all the coordinates and calculate based on the requirements and then click on the same.

Kindly, help me if there is any where i can get all the coordinates like $left, $right, $top, $bottom and perform calculations on the same.

Link to comment
Share on other sites

  • Moderators

@SAN123SAD first off, is this a GUI you created, or a third-party application? Have you tried using the Control* methods to interact with the GUI, so you don't have to bother with MouseMove and MouseClick? How about posting your code so we can see what you're trying to do, rather than having us guess?

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

On 2/22/2017 at 6:51 PM, JLogan3o13 said:

@SAN123SAD first off, is this a GUI you created, or a third-party application? Have you tried using the Control* methods to interact with the GUI, so you don't have to bother with MouseMove and MouseClick? How about posting your code so we can see what you're trying to do, rather than having us guess?

It is a thick Client GUI and it is created using JAVA. I tried using Control Methods, By using control methods i was not able to click on the desired point.

ControlMove("Subex ROC Partner Settlement 9.7 Client - ConciliaCore","","1706590",521,22,1280,69)
ControlClick("Subex ROC Partner Settlement 9.7 Client - ConciliaCore","Billing","1706590","LEFT",1,521,22)

These are the control methods lines i am trying to use.  I have a doubt here, Control methods also use coordinates ryt?

Let me know if there is any way of moving forward.

Link to comment
Share on other sites

  • Moderators

You can use WinGetPos as J1 suggests if you want to stick with mouse manipulation. There is also a Java UDF, or the IUIAutomation thread in our examples forum. I believe both could be of use to you.

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

7 minutes ago, JohnOne said:

Any coordinate parameters you pass tp MouseClick function can be made relative to your active java window, so 0, 0 would be corner of the window.

JohnOne, I have set the Mousecoordmode to 0 so it will always try to pick up the relative position in the active java window. But i see sometimes it acts abruptly and clicks in the wrong points and opens other window which were not supposed to be clicked on. I was thinking since i am using mousecoordinates so it is happening like this and started to explore on how it can pick up the mouse coordinates for every window and calculate. Based on calculation which ever the desired point it can reach on.

Since i will be creating an automation suite for the same i cannot monitor as to it will hit right spot everytime.

'Correct me if i am wrong?

Link to comment
Share on other sites

You are not wrong, if you script is to be distributed then UIAutomation is the way to go, because even if you get the mouseclicks right on your system, the window might be resized on another.

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Link to comment
Share on other sites

7 minutes ago, JohnOne said:

You are not wrong, if you script is to be distributed then UIAutomation is the way to go, because even if you get the mouseclicks right on your system, the window might be resized on another.

UIAutomation is the one which Microsoft owns right? Is the open sourced?

Link to comment
Share on other sites

It uses different tech than AutoIt, the udf just utilizes it.

I personally have not used it, but it is specifically created to handle controls which AutoIt (windows api) cannot natively handle.

There are many examples in the thread which is stickied, and is much more complicated than Mouse* and Control* functions.

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...