Returns a string containing the process name that belongs to a given PID
#include <Process.au3>
_ProcessGetName ( $iPID )
$iPID | The PID of a currently running process. |
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 |
Supplementary to ProcessExists().
#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)