Wilson WindowWare Tech Support

WinBatch WinBatch+Compiler WebBatch
Home | Tech Database | Tech BBS | White Papers | Purchase


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