Returns the native handle for the associated process. The handle is only available if this component started the process.
[Visual Basic] Public ReadOnly Property Handle As Integer [C#] public int Handle {get;} [C++] public: __property int get_Handle(); [JScript] public function get Handle() : int;
The handle assigned to the associated process when it was started, used by the operating system to keep track of process attributes.
Handle is a way to refer to a process from within an application. The instance handle is the base address at which the application loaded. In Win32, each application has its own address space, so instance handles of different process can be identical. Therefore, unlike the case under Win16, under Win32, you cannot identify a process by its instance handle because it is not guaranteed to be unique.
A unique application can obtain a handle to a process which can be used as a parameter to many process-information and control functions. This handle is private to an application--process handles cannot be shared. In addition to the handle, a process has a process Id which, unlike the Handle, is valid throughout the system.
Handle has the value zero (0) if it has not been set. This usually implies that the process has not been started, because starting a process causes the operating system to assign it a process handle. Only processes started through a call to Start cause the Handle property to be populated.
When you start a Process within a calling application, the HandleCount increments to reflect the active process. You associate additional Win32 handles to the process by calling the process additional times in your code. When a process is terminated, the HandleCount is decreased.
Process Class | Process Members | System.Diagnostics Namespace | Id | ExitCode | ExitTime | HandleCount | Start | Refresh