Skip to main content

Get-Process-PID

Command Description

Get the PID of the program corresponding to the window

Command Prototype

iRet = Window.GetPID(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

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

Demo

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")
TracePrint(iRet)