Function Reference


_ProcessGetName

Returns a string containing the process name that belongs to a given PID

#include <Process.au3>
_ProcessGetName ( $iPID )

Parameters

$iPID The PID of a currently running process.

Return Value

Success: the name of the process.
Failure: an empty string and sets the @error flag to non-zero.
@error: 1 - Process doesn't exist
2 - Error getting process list
3 - No processes found

Remarks

Supplementary to ProcessExists().

Example

#include <MsgBoxConstants.au3>
#include <Process.au3>

Run("notepad.exe")
WinWaitActive("[CLASS:Notepad]", "")
Local $iPid = WinGetProcess("[CLASS:Notepad]", "")
Local $sName = _ProcessGetName($iPid)

MsgBox($MB_SYSTEMMODAL, "Notepad - " & $iPid, $sName)