Skip to main content


Command Description

Get the PID of the program corresponding to the window

Command Prototype

iRet = Window.GetPID(objUiElement)

Parameter Description

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


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


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

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

// Command prototype: iRet = Window.GetPID(objUiElement)
// --------------------------------------------------------

iRet = Window.GetPID(@ui"window_Baidu, you will know-User Configuration 1-MicrosoftEdge10")