Jump to content
Sign in to follow this  
matsa

active window size?

Recommended Posts

matsa

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!

Share this post


Link to post
Share on other sites
Wolfshare

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

Share this post


Link to post
Share on other sites
FireFox

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.


 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites
matsa

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

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  

×