Friends who do Java or other languages should have a deep understanding. If you open a process in the program, how to get improved events is very troublesome. Now, C # gives us a very convenient, which tells how to open a process and get an event ended over.
namespace rooksoft.Demo {public class OpenProcess {// static variable represents the current program is running static bool IsRunning = true; public static void Main () {// establish a process object System.Diagnostics.Process p = new System.Diagnostics.Process (); // add the process ending event handler p.Exited = new System.EventHandler (OpenProcess.Process_OnExit); p.EnableRaisingEvents = true; p.SynchronizingObject = null; p.StartInfo.FileName = "notepad.exe" ; // Start the process P.Start (); // Keep the program runs while (isrunning) {system.threading.thread.sleep (1000);}} // process end event handler Static Void Process_ONEXIT (Object Sender, System. Eventargs e) {system.windows.Forms.MessageBox.show ("NotePad Was Closed"); isRunning = false; // Set the label to false}}} The whole process is very simple, is it a very easy thing? . Zlyperson@163.net