プロセスを開始し、プロセスが終了したときに処理するイベント ハンドラーをフックするコードがいくつかあります。私が持っているコードは C# で書かれており、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
}
私は Delphi についてあまり知らないので、助けていただければ幸いです。