Sys_GetProcessID
Description
Section titled “Description”Gets the process IDs of the running processes with the specified name.
Syntax
Section titled “Syntax”Sys_GetProcessID(sProcessExeName, bReturnAsArray, bMustExist) As Boolean
Parameters
Section titled “Parameters”sProcessExeName (String)
Section titled “sProcessExeName (String)”File name of the process, for example notepad.exe
bReturnAsArray (Boolean)
Section titled “bReturnAsArray (Boolean)”True stores the IDs of all the processes in gaValue. False stores the ID of the first process found in giValue.
bMustExist (Boolean)
Section titled “bMustExist (Boolean)”If True, the function returns False when the process isn’t running
Return value
Section titled “Return value”If bReturnAsArray is True, the process IDs are stored in gaValue. Otherwise the ID of the first process found is stored in giValue.
If the process isn’t running and bMustExist is False, gbValue is False, the function returns True, and gaValue and giValue aren’t updated.
Example
Section titled “Example”If bStatus Then bStatus=Sys_GetProcessID("CapaInstaller.exe", True, False)If bStatus And IsArray(gaValue) Then For index = LBound(gaValue) To UBound(gaValue) bStatus = Job_WriteLog("Custom", "Index #" & index & ": " & cStr(gaValue(index)), bStatus, True) NextEnd IfRelated functions
Section titled “Related functions”Sys_WaitForProcess Sys_Sleep Sys_KillProcess Sys_GetProcessOwner Sys_CompareProcessOwner Constants Package Property Variables