I have some code that starts a process and hooks up an event handler to handle when the process exits, the code I have is written in C# and I wonder if something similar is possible with Delphi.
System.Diagnostics.Process myProcess = new System.Diagnostics.Process();
myProcess.StartInfo.FileName = "notepad.exe";
myProcess.EnableRaisingEvents = true;
myProcess.Exited += new System.EventHandler(Process_OnExit);
myProcess.Start();
public void Process_OnExit(object sender, EventArgs e)
{
//Do something when the process ends
}
I don't know much about Delphi so any help would be appreciated, thanks.