当被Run执行的应用程序执行完后,再运行Run()以后的代码
编号:QA003042
建立日期: 2000年6月15日 最后修改日期:2000年6月15日
所属类别:
李逍遥:
操作系统: Windows98
编程工具: Powerbuilder 4.0
问题: 我用Run运行其它应用程序。那么请问:
如果我想当被Run执行的应用程序执行完后,再运行Run()以后的代码。(看成是模式窗口)请问怎么样实现?
水平: 中级
回答:
我做了一个打开计算器的例子(
runcalc.pbl),如果你使用pb4.0请参考如下代码!
tool:pb6.5:
os: win98:
例程:
Function long FindWindowA (String lpClassName , String lpWindowName ) Library "user32.dll"
Function boolean IsWindow (Long hwnd ) Library "user32.dll"
uint lu_return
ulong lu_handle
int iloop
string sPath
SetPointer(HourGlass!)
st_message.text = '正在执行程序,请稍等...'
run("calc")
for iloop= 1 to 10000
lu_handle = FindWindowA("scicalc","计算器")
yield()
if lu_handle <> 0 then
exit
end if
next
file://Loop until that window is no longer there
Do While isWindow(lu_handle)
Yield()
Loop
file://应用执行完成
st_message.text = '执行完成'
MessageBox("ok", "应用程序执行完成")
相关问题:
QA000021 "顺序调用多个可执行文件"
此问题由Richard回答。
| |
|
|
| |
|
|