Set wnd = CreateObject("UltraMon.Window")
msg = "Application windows (title caption followed by position in format required by WndLayout script):" & vbNewline & vbNewline
For Each w In wnd.GetAppWindows(False)
	If w.ShowState > 1 Then 'window is not hidden or minimized
		msg = msg & w.Title & ": "
		If w.ShowState = 3 Then 'window is maximized
			msg = msg & w.Monitor
		Else
			msg = msg & w.Left & "," & w.Top & "," & w.Width & "," & w.Height
		End If
		msg = msg & vbNewline
	End If
Next

WScript.Echo msg
