Jump to content

active window size?


matsa
 Share

Go to solution Solved by FireFox,

Recommended Posts

Please forgive this noob for asking such simple things. So far I haven't figured out which function can tell me the dimensions of an active window.

(Say, I want to click on the "OK" button of a dialog box that always pops in the center of a window. I know the offset of the OK button from the center, i.e. 200,200. So if I can get the size of the windows, then I can get the coords of the center and then easily calculate where exactly that "OK" button is.)

I hope my question makes sense.  :rolleyes:

Thank you!

Link to comment
Share on other sites

Please forgive this noob for asking such simple things. So far I haven't figured out which function can tell me the dimensions of an active window.

(Say, I want to click on the "OK" button of a dialog box that always pops in the center of a window. I know the offset of the OK button from the center, i.e. 200,200. So if I can get the size of the windows, then I can get the coords of the center and then easily calculate where exactly that "OK" button is.)

I hope my question makes sense.  :rolleyes:

Thank you!

You just want to click on okay button, you know the coord? Use http://www.autoitscript.com/autoit3/docs/functions/MouseClick.htm

Link to comment
Share on other sites

  • Solution

matsa,

Welcome to the autoit forum :)

Take a look at the helpfile:

-WinGetPos, get the position and size of a window.

-MouseClick

However, I advice you to use ControlClick and get the window/button infos with the infotool.

Br, FireFox.

Link to comment
Share on other sites

-WinGetPos, get the position and size of a window.

 

Thank you, exactly what I was looking for.

However, I advice you to use ControlClick and get the window/button infos with the infotool.

 

It's a web page I am working with, which doesn't seem to use windows controls, and thus ControlClick doesn't seem to apply. Wish it did. Thank you though.

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...