Result = ProgramID(Program)
Returns the unique system identifier for the given program. This is the so called "Process ID" or "PID".


Program The program to use. It must have been started before with RunProgram().

Return value

The unique system identifier for the given program.

If the identifier cannot be returned, -1 will be returned.
This will happen if RunProgram() is used to open a file in another program, like RunProgram("Source.pb").

Note: the value returned here is not a handle (unlike with most other ...ID() functions). Rather, it is the Process ID which may be viewed within the Taskmanager. To get a process handle, use the OpenProcess_() API.

Note: The returned value may be false if the process is launched by a wrapper as is the case with Windows 10 and UWP (Universal Windows Platform) applications launched by ApplicationFrameHost.exe (AFH).

Supported OS


<- ProgramFilename() - Process Index - ProgramParameter() ->