Skip to main content

Change-Window-Size

Command Description

Change the size of a window (in pixel)

Command Prototype

Window.SetSize(objUiElement,w,h)

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
wTruenumber800Window width
hTruenumber600Window height

Demo

TracePrint "--------------------Resize window--------------------" 
// --------------------------------------------------------
// [Remarks] To change the window size, this Demo uses IE to open Baidu
// Input parameter 1:
// objUiElement--target element
// Input parameter 2:
// w--width
// Input parameter 3:
// h--height

// Command prototype: Window.SetSize(objUiElement,w,h)
// --------------------------------------------------------

Window.SetSize(@ui"window_Baidu, you will know-user configuration 1-MicrosoftEdge5",800,600)