Checking if it's still running is easy: Process.HasExited
.
Rather than polling this periodically, however, you could set EnableRaisingEvents
to true, and attach a handler to the Exited
event.
EDIT: To answer the question in the comment about "fetching" the process - that depends on what you already know. If you know its process ID, you could use Process.GetProcessById
. If you only know its name, you would have to use Process.GetProcessesByName
and work out what to do if you get multiple results. If you don't know the exact name, you could use Process.GetProcesses
and look for whatever you do know about it. Those options are effectively in order of preference :)