GetWindowSize

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
User avatar
pgriffin
Automation Wizard
Posts: 460
Joined: Wed Apr 06, 2005 5:56 pm
Location: US and Europe

GetWindowSize

Post by pgriffin » Wed Sep 27, 2006 9:22 pm

Starting to put together some VBScript to get the size of an open window. I found only one post about GetWindowSize...wasn't quite what I need.

Has anyone written this already?

User avatar
JRL
Automation Wizard
Posts: 3532
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Wed Sep 27, 2006 9:36 pm

Paul,

You could use:
GetActiveWindow>window_title,X,Y[,Width,Height]
Retrieves information about the current active window. The window title, and top left coordinates of the active window are stored in window_title, X and Y.
...The optional parameters Width and Height will return the width and height of the window respectively.
Later,
Dick

User avatar
pgriffin
Automation Wizard
Posts: 460
Joined: Wed Apr 06, 2005 5:56 pm
Location: US and Europe

Post by pgriffin » Wed Sep 27, 2006 9:59 pm

Thanks Dick.

I think you are on the right track. I can use the x,y from GetActiveWindow, but I need the X,Y from the bottom, right of the active screen as well. I want feed these into the ScreenCapture command....

User avatar
JRL
Automation Wizard
Posts: 3532
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Wed Sep 27, 2006 10:02 pm

I must be missing something. If you need the lower right window coordinates, can't you just add x + width, y + height?

User avatar
pgriffin
Automation Wizard
Posts: 460
Joined: Wed Apr 06, 2005 5:56 pm
Location: US and Europe

Post by pgriffin » Mon Oct 09, 2006 9:43 pm

Dick,

Wow, I must have been drunk! For some reason I revisited this issue today and immediately realized what you were saying. It's like I have tunnel vision and could not even see the option W and H settings on GetActiveWindow.....

got it written. thanks for the good advice, even if I couldn't see it.

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts