Skip to main content

Bring-Window-to-Top

Command Description

Make window always appear on top or cancel this operation

Command Prototype

Window.TopMost(objUiElement,bTopMost)

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
bTopMostTruebooleanTrueWhether to pin the window to top. If true is passed, pin the corresponding window to top, otherwise, cancel

Demo

TracePrint "--------------------Window on top--------------------" 
// --------------------------------------------------------
// [Remarks] The window is on top, the demo uses IE to open Baidu
// Input parameter 1:
// objUiElement--target element
// Input parameter 2:
// bTopMost--whether to top

// Command prototype: Window.TopMost(objUiElement,bTopMost)
// --------------------------------------------------------

Window.TopMost(@ui"window_Baidu, you will know-User Configuration 1-MicrosoftEdge7",true)