0

I have a c# project that I am working on and in this program it launches another (.exe) program. What I want to do is watch for when that program closes and when it does run code a certain function. Is this possible? Below is my code I'm using to launch the external program.

System.Diagnostics.Process.Start(@"C:\Temporary\SOS.exe");

xjacksssss
  • 49
  • 9

1 Answers1

1

Listen for the Process.Exited event. In the event handler, call your function. https://msdn.microsoft.com/en-us/library/system.diagnostics.process.exited(v=vs.110).aspx

Jeff Anderson
  • 799
  • 7
  • 18