Ver Mensaje Individual
  #3  
Antiguo 10-01-2006
Avatar de delphi.com.ar
delphi.com.ar delphi.com.ar is offline
Federico Firenze
 
Registrado: may 2003
Ubicación: Buenos Aires, Argentina *
Posts: 5.932
Reputación: 27
delphi.com.ar Va por buen camino
Podrías utilizar CreateProcess, y averiguar el código de salida con GetExitCodeProcess.
Código Delphi [-]
var
  StartInfo: STARTUPINFO;
  ProccesInfo: PROCESS_INFORMATION;
  dwExitCode: DWORD;
begin
  ZeroMemory(@StartInfo, SizeOf(STARTUPINFO));
  with StartInfo do
  begin
    cb := SizeOf(STARTUPINFO);
    dwFlags := STARTF_USESHOWWINDOW;
    wShowWindow := SW_HIDE;
  end;
  Win32Check(CreateProcess(nil, PChar('calc.exe') ,nil, nil, FALSE,
                           CREATE_NEW_CONSOLE, nil, nil, StartInfo, ProccesInfo));
  WaitForSingleObject(ProccesInfo.hProcess, INFINITE);
  GetExitCodeProcess(ProccesInfo.hProcess, dwExitCode);

  ShowMessageFmt('Salida: %d', [dwExitCode]);

Saludos!
__________________
delphi.com.ar

Dedique el tiempo suficiente para formular su pregunta si pretende que alguien dedique su tiempo en contestarla.
Responder Con Cita