procedure TForm1.Button1Click(Sender: TObject);<br>var<br> StartInfo : TStartupInfo;<br> ProcInfo : TProcessInformation;<br> CreateOK : Boolean;<br> ProgramName: String;<br>begin<br> ProgramName := 'calc.exe';<br> FillChar(StartInfo,SizeOf(TStartupInfo),#0);<br> FillChar(ProcInfo,SizeOf(TProcessInformation),#0);<br> StartInfo.cb := SizeOf(TStartupInfo);<br> CreateOK := CreateProcess(nil,<br> PChar(ProgramName), nil, nil,<br> False,<br> CREATE_NEW_PROCESS_GROUP +<br> NORMAL_PRIORITY_CLASS,<br> nil, nil, StartInfo, ProcInfo);<br> Sleep(1000);<br> if CreateOK then<br> TerminateProcess(ProcInfo.hProcess, 0);<br>end;