我做了一个函数 Public Function ShellX(ByVal strRun As String, _ ByVal AppWinStyle As VbAppWinStyle) As Double '用同步方式执行Shell Dim hProcess As Long Dim rc As Long Dim Code As Long
rc = Shell(strRun, AppWinStyle) hProcess = OpenProcess(PROCESS_QUERY_INFORMATION, False, rc) Do GetExitCodeProcess hProcess, Code DoEvents Loop While Code = STILL_ACTIVE
Public Function ShellX(ByVal strRun As String, _
ByVal AppWinStyle As VbAppWinStyle) As Double
'用同步方式执行Shell Dim hProcess As Long
Dim rc As Long
Dim Code As Long
rc = Shell(strRun, AppWinStyle)
hProcess = OpenProcess(PROCESS_QUERY_INFORMATION, False, rc)
Do
GetExitCodeProcess hProcess, Code
DoEvents
Loop While Code = STILL_ACTIVE
End Function
withstudy的方法能说具体点儿吗?谢谢,一定再加分!