以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  [求助]调用了外部EXE,如何让这个EXE完全运行完毕了,在执行下一个动作  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=115407)

--  作者:brian0101
--  发布时间:2018/3/6 22:13:00
--  [求助]调用了外部EXE,如何让这个EXE完全运行完毕了,在执行下一个动作
求助,各位专家
Dim Proc As New Process
Proc.File = "D:\\Program Files\\National Instruments\\LabVIEW 2017\\LabVIEW.exe"
Proc.Start
Proc.WaitForInputIdle() \'等程序自动结束并进入空闲状态
MessageBox.Show("1")
想让这个labview.exe运行起来了在弹窗,但是实际总是 1这个窗口先提示

--  作者:有点蓝
--  发布时间:2018/3/6 22:40:00
--  
System_CAPS_pubmethodWaitForInputIdle()

Process component to wait indefinitely for the associated process to enter an idle state." xml:space="preserve" style="color: rgb(42, 42, 42);">使 Process 组件无限期地等待关联进程进入空闲状态。 此重载仅适用于具有用户界面并因此具有消息循环的进程

System_CAPS_pubmethodWaitForInputIdle(Int32)

Process component to wait the specified number of milliseconds for the associated process to enter an idle state." xml:space="preserve">使 Process 组件在指定的毫秒数内等待关联进程进入空闲状态。 此重载仅适用于具有用户界面并因此具有消息循环的进程。

首先这个程序必要有用户窗口界面或者命令行界面

1、可以试试:Proc.WaitForInputIdle(2000) 等2秒
2、试试
Dim Proc As New Process
Proc.File = "D:\\Program Files\\National Instruments\\LabVIEW 2017\\LabVIEW.exe"
Proc.Start
system.threading.thread.sleep(2000) 等2秒
MessageBox.Show("1")