Salut Steve Batson !
Dans un message de Steve Batson dat‚ du 21 Aug 96 08:28:31 il ‚tait dit:
SB> I got the following code from the Borland Web site and I think
SB> I have seen it or something like it here in the past. Anyway, this
SB> only works in Delphi 1.x, does anyone have a Delphi 2.0 function that
SB> will do the same thing? Or, if you know how to modify it, that would
SB> be helpful. Here is the function: Function WinExecAndWait(Path :
Here is some code extracted from one of my applications. It should do
what you are looking for. Let me know if it does.
function StartApplication(ExeName : String): Boolean;
var
StartupInfo: TStartupInfo;
ProcessInfo: TProcessInformation;
begin
FillChar(StartupInfo, SizeOf(TStartupInfo), 0);
with StartupInfo do begin
cb := SizeOf(TStartupInfo);
dwFlags := STARTF_USESHOWWINDOW or STARTF_FORCEONFEEDBACK;
wShowWindow := SW_SHOWNORMAL;
end;
Result := CreateProcess(nil, PChar(ExeName), nil, nil, False,
NORMAL_PRIORITY_CLASS, nil, nil,
StartupInfo, ProcessInfo);
if Result then begin
with ProcessInfo do begin
WaitForInputIdle(hProcess, INFINITE);
WaitForSingleObject(ProcessInfo.hProcess, INFINITE);
CloseHandle(hThread);
CloseHandle(hProcess);
end;
end;
end;
Amiti‚s,
{-Francois Piette-}
--- SvFido 1.32
---------------
* Origin: OverByte BBS (Embourg-Belgium) 32-41-651395 V-FAST (2:293/2202)
|