[To be supplied.]
The following declaration shows the syntax for a method that handles the Exited event.
[Visual Basic] Private Sub ProcessName_Exited( _ ByVal sender As Object, _ ByVal e As EventArgs _ ) [C#] private void ProcessName_Exited( object sender, EventArgs e ); [C++] private: void ProcessName_Exited( Object* sender, EventArgs* e ); [JScript] private ProcessName_Exited( sender : Object, e : EventArgs );
Property | Description |
---|---|
|
The System.Diagnostics.Process.Exited event indicates that the associated process exited. This can mean either a process termination (aborted process) or a successfully closed process. When the operating system shuts down a process, any process component that is waiting for an exit is notified. The component can then access the associated process information that is still resident in the operating system memory, like ExitTime, by using the handle that it has to the process.
Because the associated process has exited, the handle that the process component has no longer points to an existing process resource. Instead, it can only be used to access the operating system's information about the process resource. The system is aware of handles to exited processes that have not been released by Process components, and keeps the ExitTime and Handle information in memory until the Process component specifically frees the resources.
Note Even if you have a handle to an exited process, you cannot call Start again to reconnect to the same process. Calling Start releases the associated process automatically, and connects to a process with the same file but an entirely new Handle.
Process Class | Process MembersTopic | System.Diagnostics Namespace