Thanx,
Abram Weas
If you want to wait for the executed program try this function :
{---------------------------------------------------------------------------}
function WaitforProgram(name : string) : boolean;
var
StartUpInfo : TStartUpInfo;
ProcessInfo : TProcessInformation;
begin
FillChar(StartUpInfo,SizeOf(StartupInfo),0);
with StartupInfo do
begin
cb := SizeOf(StartupInfo);
dwFlags := STARTF_USESHOWWINDOW or STARTF_FORCEONFEEDBACK;
wShowWindow := SW_SHOWNORMAL;
end;
if CreateProcess(PChar(name),'',nil, nil,False, NORMAL_PRIORITY_CLASS,
nil, nil, StartUpInfo, ProcessInfo) then
begin { wait for window}
if WaitForInputIdle(ProcessInfo.hProcess,1000) <> 0 then
begin
Result:=false; //no reaction ??
Exit;
end;
end
else
begin
Result:=false; // Program not found
Exit;
end;
WaitForSingleObject(ProcessInfo.hProcess, INFINITE);
Result:=true;
end;
{---------------------------------------------------------------------------}
For parameters try to replace the empty string in CreateProcess (see
also in the helpfile)
I hope that will help you! - Ronny