Delphi - Problemas con ShellExecut

 
Vista:
sin imagen de perfil

Problemas con ShellExecut

Publicado por carlitos (78 intervenciones) el 04/04/2011 20:57:53
Hola:

Estoy mandando a correr un programa de calculo desde mi aplicacion delphi con shellexcute. Necesito saber cuando termina de calcular para luego hacer otras operaciones. Necesito saber cuando termina, hasta ahora lo hago con WaitForSingleObject y funciona bien. Lo que pasa es que hasta que no termina me congela la ventana de mi programa. El calculo puede demorar 20 minutos.

Que pudiera hacer para mantener mi ventana activa mientras espero a que termine de calcular y me entero?

saludos,
gracias mil

yo lo hago asi:

Procedure TForm1.Button3Click(Sender: TObject);
var
Info:TShellExecuteInfo;
begin
with Info do begin
cbSize := SizeOf(ShellExecuteInfo);
fMask := SEE_MASK_NOCLOSEPROCESS;
Wnd := Handle;
lpVerb := 'open';
lpFile := PChar('C:\CALPUFF\CALPro\prtmet.exe');
lpParameters := PChar('D:\MQA\ficheros\Malla\Calmet\d0.5-3\20050713\B1\prtmet.inp') {nil};
lpDirectory := PChar('D:\MQA\ficheros\Malla\Calmet\d0.5-3\20050713\B1\'){nil};
nShow := SW_SHOW;
end;
{ShellExecuteEx(Self.Handle {handle, NULL,'C:\CALPUFF\CALPro\prtmet.exe,NULL, NULL, Sw_ShowNormal);}
ShellExecuteEx(@INFO);
WaitForSingleObject(Info.hProcess, INFINITE);
MessageBox(0, 'Done!', nil, 0);
end;
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder
sin imagen de perfil

Problemas con ShellExecut

Publicado por lopez (78 intervenciones) el 11/04/2011 04:32:39
ya resolvi, asi:

Repeat
Application.ProcessMessages;
until WaitForSingleObject(Info.hProcess,500)<> WAIT_TIMEOUT;
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar