调用其它程序(如UDL),怎么使他成为自己的模态窗口? ( 积分: 50 )

  • 主题发起人 主题发起人 conis
  • 开始时间 开始时间
C

conis

Unregistered / Unconfirmed
GUEST, unregistred user!
就是没有关闭之前,不能在本程序内操作?
 
就是没有关闭之前,不能在本程序内操作?
 
[blue]http://www.delphibbs.com/delphibbs/dispq.asp?lid=311324[/blue]<br><br>procedure TfrmMain.WaitOnProgram(Const sCommandLine:string;<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Const waitdead:Boolean;var iExit:Cardinal);<br>var<br> &nbsp;bCreateProcess: LongBool;<br> &nbsp;lpStartupInfo: _STARTUPINFOA;<br> &nbsp;lpProcessInformation: _PROCESS_INFORMATION;<br>begin<br> &nbsp;lpStartupInfo.dwFlags := STARTF_USESHOWWINDOW;<br> &nbsp;lpStartupInfo.wShowWindow := SW_MINIMIZE;<br> &nbsp;bCreateProcess:=CreateProcess(nil,PChar(sCommandLine),<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;nil,nil,False,<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;NORMAL_PRIORITY_CLASS,nil,nil,<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;lpStartupInfo,lpProcessInformation);<br> &nbsp;if bCreateProcess then<br> &nbsp;begin<br> &nbsp; &nbsp;if waitdead then<br> &nbsp; &nbsp;begin<br> &nbsp; &nbsp; &nbsp;WaitForSingleObject(lpProcessInformation.hProcess,INFINITE);<br> &nbsp; &nbsp; &nbsp;//GetExitCodeProcess(lpProcessInformation.hProcess,iExit);<br> &nbsp; &nbsp;end<br> &nbsp; &nbsp;else<br> &nbsp; &nbsp;begin<br> &nbsp; &nbsp; &nbsp;GetExitCodeProcess(lpProcessInformation.hProcess,iExit);<br> &nbsp; &nbsp; &nbsp;While iExit = STILL_ACTIVE do<br> &nbsp; &nbsp; &nbsp;begin<br> &nbsp; &nbsp; &nbsp; &nbsp;frmMain.insertprocressbar;<br> &nbsp; &nbsp; &nbsp; &nbsp;Application.ProcessMessages;<br> &nbsp; &nbsp; &nbsp; &nbsp;GetExitCodeProcess(lpProcessInformation.hProcess,iExit);<br> &nbsp; &nbsp; &nbsp;end;<br> &nbsp; &nbsp;end;<br> &nbsp;end<br> &nbsp;else<br> &nbsp;begin<br> &nbsp; &nbsp;iExit:=9999;<br> &nbsp; &nbsp;ShowMessage('创建进程失败!'+#10+#10+sCommandLine+'执行错误.');<br> &nbsp;end;<br>end;
 
太麻烦了吧,有没有简单一点的?
 

Similar threads

S
回复
0
查看
3K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
2K
SUNSTONE的Delphi笔记
S
D
回复
0
查看
1K
DelphiTeacher的专栏
D
后退
顶部