var ProcessInfo:TProcessInformation; //全局变量<br><br>var <br> StartupInfo:TStartupInfo;//局部变量<br>begin //运行某个程序,其文件名由参数指定<br> ZeroMomery(@StartupInfo,Sizeof(StartupInfo));<br> StartupInfo.Cb:=Sizeof(StartupInfo);<br> CreateProcess('文件名','命令行参数',nil,nil,false,<br> Normal_Proirity_Class,nil,nil,StartupInfo,ProcessInfo);<br>end;<br><br>以下是中止用以上命令打开的程序<br>TerminateProcess(ProcessInfo.HProcess,0);<br>