NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

Process.HasExited

Gets a value indicating whether the associated process has been terminated.

[Visual Basic]
Public ReadOnly Property HasExited As Boolean
[C#]
public bool HasExited {get;}
[C++]
public: __property bool get_HasExited();
[JScript]
public function get HasExited() : Boolean;

Property Value

true if the operating system process referenced by the Process component has terminated; otherwise, false.

Exceptions

Exception Type Condition
SystemException There is no process associated with the object.
Win32Exception The exit code for the process could not be retrieved.

Remarks

A value of true for HasExited indicates that the associated process has terminated, either normally or abnormally. You can request or force the associated process to exit by calling CloseMainWindow or Kill. When the process has exited, the operating system releases process memory, but retains administrative information about the process like the handle, exit code and exit time. You can use the ExitCode and ExitTime to view this information. This information is released when all Process components associated with the system process are destroyed and hold no more handles to the exited process.

A process can terminate independently of the code being processed. The value of System.Diagnostics.Process.Exited is updated automatically, even if the associated process exits independently.

See Also

Process Class | Process Members | System.Diagnostics Namespace | ExitCode | ExitTime | WaitForExit | WatchForExit | OnExited