var<br> pInfo:TProcessInformation;<br> sInfo:TStartupInfo;<br><br>procedure TForm1.Button1Click(Sender: TObject);<br>begin<br><br> sInfo.cb := SizeOf(sInfo);<br> sInfo.dwFlags := STARTF_USESHOWWINDOW;<br> sInfo.wShowWindow := SW_SHOW;<br> if not CreateProcess('c:/windows/notepad.exe',nil,nil,nil,False,0,nil,nil,sInfo,pInfo) then<br> showmessage('Failed!');<br>end;<br><br>procedure TForm1.Button2Click(Sender: TObject);<br>begin<br> TerminateProcess(pInfo.hProcess,0);<br>end;<br><br>