Say I have created a process using Process.Start();.
How would I tell if it had been closed/terminated, without freezing the application.
In CSharp, of course.
Thanks!
Say I have created a process using Process.Start();.
How would I tell if it had been closed/terminated, without freezing the application.
In CSharp, of course.
Thanks!
Try the following
Process p = Process.Start(...);
p.Exited += OnProcessExited;
private void OnProcessExited(object sender, EventArgs e) {
// Put code here
}
There is one catch to this code though. It's possible for the Process
to exit before the event handler is attached. So you may not receive this event for a Process
which exits quickly.