启动外部程序并等待它结束(3)

2008-04-09 04:28:22来源:互联网 阅读 ()

新老客户大回馈,云服务器低至5折

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;

……

不难理解吧?

标签:

版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com
特别注意:本站所有转载文章言论不代表本站观点,本站所提供的摄影照片,插画,设计作品,如需使用,请与原作者联系,版权归原作者所有

上一篇:轻松实现DBGrid的多表头

下一篇:谈Delphi编程中“流”的应用--可读写信息在文件中