Skip to main content

Set-Active-Window

Command Description

Set the specified window to be active window in the foreground

Command Prototype

Window.SetActive(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

Demo

TracePrint "--------------------Set Active Window--------------------" 
// --------------------------------------------------------
// [Remarks] Set the active window, the Demo uses IE to open Baidu
// Input parameters:
// objUiElement--target element

// Command prototype: Window.SetActive(objUiElement)
// --------------------------------------------------------

Window.SetActive(@ui"window_Baidu, you will know-User Configuration 1-MicrosoftEdge")