Skip to main content

Get-Window-Size

Command Description

Get the size of a window (in pixel)

Command Prototype

objRect = Window.GetSize(objUiElement)

Parameter Description

ParameterRequiredTypeDefaultDescription
objUiElementTruedecorator@ui""Corresponding window object; when passed as an integer, it is used as a window handle; when passed as a string, it is used as a window feature to find all matched window to operate; when passed as a UiElement object, operate the window containing it

return

objRect,The variable used to save the output of the command.

Demo

TracePrint "--------------------Get window size--------------------" 
// --------------------------------------------------------
// [Remarks] Get the window size, this Demo uses IE to open Baidu
// Input parameters:
// objUiElement--target element

// Output parameters:
// objRect--The variable to which the output of the function call is saved

// Command prototype: objRect = Window.GetSize(objUiElement)
// --------------------------------------------------------

objRect = Window.GetSize(@ui"window_Baidu, you will know-User Configuration 1-MicrosoftEdge4")
TracePrint(objRect)