Ver Mensaje Individual
  #6  
Antiguo 19-01-2012
Delfino Delfino is offline
Miembro
 
Registrado: jul 2003
Ubicación: Madrid
Posts: 974
Reputación: 21
Delfino Va por buen camino
Lo hago asi
Código Delphi [-]
function ExecWait(ExeFile, Params: string): Boolean;   //  Synchronous ShellExecute
  var SEInfo: TShellExecuteInfo;
      ExitCode: DWORD;
begin
  FillChar(SEInfo, SizeOf(SEInfo), 0) ;
  SEInfo.cbSize := SizeOf(TShellExecuteInfo) ;
  with SEInfo do
  begin
   fMask := SEE_MASK_NOCLOSEPROCESS;
   Wnd := Application.Handle;
   lpFile := PChar(ExeFile) ;
   lpParameters := PChar(Params) ;
   lpDirectory := 'C:\' ;
   nShow := SW_HIDE;
  end;
  if ShellExecuteEx(@SEInfo) then
  begin
   repeat
    Application.ProcessMessages;
    GetExitCodeProcess(SEInfo.hProcess, ExitCode) ;
   until (ExitCode <> STILL_ACTIVE) or (Application.Terminated);
   Result := True;
  end
  else
   Result := False;
end;
__________________
¿Microsoft? No, gracias..
Responder Con Cita