Returns the process ID (PID) of the process which created the specified process.
PID := ProcessGetParent(PIDOrName)
If omitted, the script's own process is used. Otherwise, specify either a number (the PID) or a process name:
PID: The Process ID, which is a number that uniquely identifies one specific process (this number is valid only during the lifetime of that process). The PID of a newly launched process can be determined via the Run function. Similarly, the PID of a window can be determined with WinGetPID. ProcessExist can also be used to discover a PID.
Name: The name of a process is usually the same as its executable (without path), e.g. notepad.exe or winword.exe. Since a name might match multiple running processes, only the first process will be operated upon. The name is not case-sensitive.
Type: Integer
This function returns the process ID (PID) of the process which created the specified process.
On Linux and macOS, it returns the current parent, which is not the creator if the creator has exited. This is unverified on macOS.
A TargetError is thrown if the specified process could not be found.
An OSError is thrown if the parent PID cannot be retrieved.
If the parent process is no longer running, there is some risk that the returned PID has been reused by the system, and now identifies a different process.