monoscout999 Posted July 5, 2011 Posted July 5, 2011 (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 July 5, 2011 by monoscout999
Gizmo42 Posted July 5, 2011 Author Posted July 5, 2011 (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 July 5, 2011 by Gizmo42
sleepydvdr Posted July 5, 2011 Posted July 5, 2011 (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 July 5, 2011 by sleepydvdr #include <ByteMe.au3>
Gizmo42 Posted July 5, 2011 Author Posted July 5, 2011 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 ?
sleepydvdr Posted July 5, 2011 Posted July 5, 2011 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=previousHere'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>
Gizmo42 Posted July 5, 2011 Author Posted July 5, 2011 (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? How can I get this position: $position[0] + 160, $position[1] + 137As you find? =/ Sorry for my bad understanding =_= Edited July 5, 2011 by Gizmo42
sleepydvdr Posted July 5, 2011 Posted July 5, 2011 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? #include <ByteMe.au3>
Gizmo42 Posted July 5, 2011 Author Posted July 5, 2011 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 ?
sleepydvdr Posted July 5, 2011 Posted July 5, 2011 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>
Gizmo42 Posted July 5, 2011 Author Posted July 5, 2011 Great! Once again, thank you so much for your help, seriously, you really helped me !!
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now