Jump to content

Recommended Posts

Posted (edited)

read the help file about the function usage and for another example. what part of my example didn`t understand?

ControlGetPos() will return an array variable with four values.

The X coordenate of the control inside the client area of the window

The Y coordenate of the control inside the client area of the window

The Width of the control

And the Height of the control.

To find out what is the absolute coordenate of the control you have to use another function

_winapi_Clienttoscreen() but you should fill a point structure for that. it`s easy. look in the help file about these function, and if still don`t get it, return here and we will point you the way.

(sorry my bad english)

Edited by monoscout999
Posted (edited)

I don't sure .. kinda all (well, still beginner) ..

This is too confusing.. I don't really know how to start, seriously .. this is new for me, I never saw that before :S

Anyway, listen, I want to do something simple:

I want to find the coordinates, the X,Y, to use the MouseClick, just like sleepydvdr did here:

$coord = WinGetPos ("Untitled - Notepad")

MouseClick("left", $coord[0] + $coord[2] - 15, $coord[1] + 15, 1)

He found the position that close the notepad for example.

So.. how?? O:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

For exmaple, I want to find the coordinates, the X,Y to this window - the OK button:

http://i54.tinypic.com/24phs2h.jpg

What should I do? :)

Edited by Gizmo42
Posted (edited)

Since you are still learning and need to read up on arrays, I suggest you download some screen calipers. I used mine to determine how far over x and y you need to click.

$position = WinGetPos("Installer Language") 
MouseClick("Left", $position[0] + 160, $position[1] + 137)

The variable $position holds the x and y values. The second line tells it to go over 160 pixel and down 137 and perform a mouseclick.

Edited by sleepydvdr

#include <ByteMe.au3>

Posted

Yep, that's exactly what I meant!

Where can I download screen calipers? and how they can help me to find the x and the y ?

Posted

Yep, that's exactly what I meant!

Where can I download screen calipers? and how they can help me to find the x and the y ?

The ones I use cost money. They used to be freeware and here's a link to the last free version of them:

http://www.portablefreeware.com/forums/viewtopic.php?f=4&t=1855&view=previous

Here's the website of the current version:

http://www.iconico.com/caliper/

The newer versions look so much better, but the free version can get the job done.

#include <ByteMe.au3>

Posted (edited)

Ok, thanks. but ..

I downloaded the free version, but I don't get it .. how can I find the X and Y of the OK button as you find with this tool?

Posted Image

How can I get this position:

$position[0] + 160, $position[1] + 137

As you find? =/

Sorry for my bad understanding =_=

Edited by Gizmo42
Posted

Screenshot using the free calipers. I ran two instances of it so I could show you the horizontal and veritcal orientations. Now do you see how I came up with 160 and 137?

Posted Image

#include <ByteMe.au3>

Posted

Ohh thank you, thank you and one more time: THANK YOU! :)

Now I get it, that's what I need! :]

But just to know ..

Because it's the x,y coordinates INSIDE a window, it will work on any resolution of screen, any operating system and any computer, no ?

Posted

Ohh thank you, thank you and one more time: THANK YOU! :)

Now I get it, that's what I need! :]

But just to know ..

Because it's the x,y coordinates INSIDE a window, it will work on any resolution of screen, any operating system and any computer, no ?

Yes, it will be consistent from one computer to the next.

#include <ByteMe.au3>

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
×
×
  • Create New...