# Function Reference

WinGetClientSize

Retrieves the size of a given window's client area.

WinGetClientSize ( "title" [, "text"] )

Parameters

title | The title of the window to read. See Title special definition.
text | [optional] The text of the window to read.

Return Value

Success: | Returns a 2-element array containing the following information:
| $array[0] = Width of window's client area
| $array[1] = Height of window's client area
Failure: | Returns 0 and sets @error to 1 if windows is not found.

Remarks

If the window is minimized, the returned width and height values are both zero. However, WinGetClientSize works correctly on (non-minimized) hidden windows. If the window title "Program Manager" is used, the function will return the size of the desktop. WinGetClientSize("") matches the active window. If multiple windows match the criteria, the most recently active window is used.

Related

WinGetPos, WinMove

Example

$size = WinGetClientSize("")
MsgBox(0, "Active window's client size is (width,height):", $size[0] & " " & $size[1])