WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Window Manipulation

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

How to Get the Size of the Active Window

Keywords: 	 WinPosition	WinMetrics

Question:

How do I get the size of the active windows in pixels?

Answer:

winpos = WinPosition(WinGetActive())
xulc = ItemExtract(1, winpos, ",")
yulc = ItemExtract(2, winpos, ",")
xbrc = ItemExtract(3, winpos, ",")
ybrc = ItemExtract(4, winpos, ",")
width = (xbrc - xulc) * WinMetrics(0) / 1000
height = (ybrc - yulc) * WinMetrics(1) / 1000

Message(width, height)

Article ID:   W14318
Filename:   Get the Size of the Active Window.txt
File Created: 1999:10:26:11:23:18
Last Updated: 1999:10:26:11:23:18