I'm trying to create a small program which will display a message box if a certain program has been exited.
Asked
Active
Viewed 706 times
-5
-
1You'll need to be more specific, program meaning function or an application itself? Also, some code showing you've made an attempt would be helpful. – Keyur PATEL Oct 20 '17 at 04:18
-
https://stackoverflow.com/questions/262280/how-can-i-know-if-a-process-is-running – caesay Oct 20 '17 at 04:24
-
See also the roughly 1000 other related posts: https://stackoverflow.com/search?q=%5Bc%23%5D+wait+for+process+to+end. – Peter Duniho Oct 20 '17 at 04:52
1 Answers
0
Ths is really subjective, In my opinion it depends if first: you are the one who started the program. This means if you use the Process Class of .NET http://msdn.microsoft.com/en-us/library/system.diagnostics.process.aspx
So saying you start a program by process.start();
you can check if it is exited using HasExited
property or you can subscribe to the Exited
Event of the process
Second Case is : If the program you are checking was started externally you can pretty much recheck it at interval Check the programs that is running by using the process class of .NET
Process.GetProcesses();
and recheck if the program is still running
But we really don't know, Please give us more details so we can help.
Thanks

keysl
- 2,127
- 1
- 12
- 16