Skip to main content

Determine-If-the-Window-Exists

Command Description

Determine if the window exists

Command Prototype

bRet = Window.Exists(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

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

Demo

TracePrint "--------------------Determine whether the window exists--------------------" 
// --------------------------------------------------------
// [Remarks] To determine whether the window exists, the Demo uses IE to open Baidu
// Input parameters:
// objUiElement--target element

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

// Command prototype: bRet = Window.Exists(objUiElement)
// --------------------------------------------------------

bRet = Window.Exists(@ui"window_Baidu, you will know-User Configuration 1-MicrosoftEdge3")
TracePrint(bRet)