如何在vb中调用外部程序?
如何在vb中调用外部程序(如:QQ)
如果外部程序关闭,控制权如何能回到主程序得手中?
[解决办法]
N=shell( "c:\qq2007\qq.exe ",1)
外部程序关闭,控制权如何能回到主程序
这个不太清楚了
我也是菜鸟..
[解决办法]
Public Sub ShellWait(cCommandLine As String, AppStyle As VbAppWinStyle)
Dim hShell As Long
Dim hProc As Long
Dim lExit As Long
hShell = Shell(cCommandLine, AppStyle)
hProc = OpenProcess(PROCESS_QUERY_INFORMATION, False, hShell)
Do
GetExitCodeProcess hProc, lExit
DoEvents
' Exit Do
Loop While lExit = STILL_ACTIVE
End Sub