【发布时间】:2010-01-05 19:32:15
【问题描述】:
我有一些代码可以启动一个进程并连接一个事件处理程序以在进程退出时进行处理,我的代码是用 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 了解不多,因此不胜感激,谢谢。
【问题讨论】: