Retrieves the size of a given window's client area.
WinGetClientSize ( "title" [, "text"] )
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. If multiple windows match the criteria, the most recently active window is used.
#include <MsgBoxConstants.au3>
Example()
Func Example()
; Run Notepad
Run ("notepad.exe")
; Wait 10 seconds for the Notepad window to appear.
Local $hWnd= WinWait ("[CLASS:Notepad]","",10)
; Retrieve the client area of the Notepad window using the handle returned by WinWait.
Local $aClientSize= WinGetClientSize ($hWnd)
; Display the height and width of the client area.
MsgBox ($MB_SYSTEMMODAL,"","Width: "&$aClientSize[0]&@CRLF &"Height: "&$aClientSize[1])
; Close the Notepad window using the handle returned by WinWait.
WinClose ($hWnd)
EndFunc ;==>Example