等待计算器结束的例子<br>var<br> StartupInfo:TStartupInfo;<br> ProcessInfo:TProcessInformation;<br>begin<br> FillChar(StartupInfo,SizeOf(StartupInfo),#0);<br> StartupInfo.cb:=SizeOf(StartupInfo);<br> StartupInfo.dwFlags:=STARTF_USESHOWWINDOW;<br> StartupInfo.wShowWindow:=sw_show;<br> CreateProcess(nil,'calc.exe',nil,nil,false,Create_new_console or Normal_priority_class,nil,nil,StartupInfo,ProcessInfo);<br> WaitForsingleobject(ProcessInfo.hProcess, INFINITE);<br>end;