Export (0) Print
Expand All

Process.Exited Event

Occurs when a process exits.

[Visual Basic]
Public Event Exited As EventHandler
[C#]
public event EventHandler Exited;
[C++]
public: __event EventHandler* Exited;

[JScript] In JScript, you can handle the events defined by a class, but you cannot define your own.

Event Data

The event handler receives an argument of type EventArgs.

Remarks

The Exited event indicates that the associated process exited. This occurrence means either that the process terminated (aborted) or successfully closed. 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 (such as ExitTime property) by using the handle that it has to the process.

Because the associated process has exited, the Handle property of the component no longer points to an existing process resource. Instead, it can be used only 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, so it keeps the ExitTime and Handle property 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 automatically releases the associated process and connects to a process with the same file but an entirely new Handle.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

.NET Framework Security: 

See Also

Process Class | Process Members | System.Diagnostics Namespace

Show:
© 2014 Microsoft