
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;
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


0