ELCouz
Messages postés135Date d'inscriptionjeudi 22 mars 2007StatutMembreDernière intervention25 juillet 2008 27 févr. 2008 à 10:09
en cherchant sur google newgroups borland delphi jai trouver ce code...
unit shell;
interface
uses
Windows, Forms, ShellAPI;
function ExecAppWait(AppName, Params: string): Boolean ;
implementation
function ExecAppWait(AppName, Params: string): Boolean;
var
ShellExInfo: TShellExecuteInfo;
begin
FillChar(ShellExInfo, SizeOf(ShellExInfo), 0);
with ShellExInfo do begin
cbSize := SizeOf(ShellExInfo);
fMask := see_Mask_NoCloseProcess;
Wnd := Application.Handle;
lpFile := PChar(AppName);
lpParameters := PChar(Params);
nShow := SW_SHOWNORMAL;
end;
Result := ShellExecuteEx(@ShellExInfo);
if Result then
while WaitForSingleObject(ShellExInfo.HProcess, 100) = WAIT_TIMEOUT do
begin
Application.ProcessMessages;
if Application.Terminated then Break;
end;
end;