Jump to content
Sign in to follow this  
Fend

WinGetPos Question

Recommended Posts

Fend

I am new to AutoIt so I apologize about the newbie questions. I have read the tutorial btw...

I am using WinGetPos to get the (x,y) coord of the application I am using. The code I wrote is

$size = WinGetPos("Nostale")

$WindowX = $size[0]

$WindowY = $size[1]

MsgBox(0,"window x,y:",$WindowX&","&$WindowY)

The resultant is 960,600 no matter where the windowed 1024by768 window is.

From reading about this function it appears that it returns the (x,y) location and the heigth and width or the window...I am lost

I guess I thought that if I moved the upper left corner of the window to say 100,100 that this function would return 100,100,1024,768


I like cookies?

Share this post


Link to post
Share on other sites
Valuater

Try this..

Run('notepad.exe')
WinWaitActive('')
$size = WinGetPos("[active]")
MsgBox(0, "Active window stats (x,y,width,height):", $size[0] & " " & $size[1] & " " & $size[2] & " " & $size[3])

re-size and move notepad, then run it again..

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites
Fend

Works better with Exit! LOL opened like 200

I still am not getting this code up and running...your example however proved that it does in fact return the right values...it must have something to do with the fact it is a game(no game gaurd).


I like cookies?

Share this post


Link to post
Share on other sites
Fend

Dear lord it was me...was a misstype on the window name...<slowly goes back to hide in the shadows>

Edited by Fend

I like cookies?

Share this post


Link to post
Share on other sites
Valuater

Well, as long as you found the answer.... it's all good

8)


NEWHeader1.png

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  

×