Click here to Skip to main content
15,895,787 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello, I want to detect when a process is closing and cancel the event. Something like FormClosing event and FormClosingEventArgs.Cancel but for other application. Is this thing possible? If it is how?
Posted

1 solution

You have two ways to be notified that a process has exited: The Process.Exited Event or the Process.WaitForExit Method. Unfortunately, these happen after the process has exited. In fact you can't event restart the same process. See this link for more information: http://msdn.microsoft.com/en-us/library/system.diagnostics.process.exited.aspx[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900