procedure TForm1.Button1Click(Sender: TObject);
var
StartupInfo: TStartupinfo;
ProcessInfo: TProcessInformation;
begin
FillChar(Startupinfo,Sizeof(TStartupinfo),0);
Startupinfo.cb:=Sizeof(TStartupInfo);
if CreateProcess(nil,
'pbrush.exe',
nil,
nil,
false,
normal_priority_class,
nil,
'c:\windows',
Startupinfo,
ProcessInfo) then
begin
WaitforSingleObject(Processinfo.hProcess, infinite);
CloseHandle(ProcessInfo.hProcess);
ShowMessage('Program er slut');
end;
end;
|