1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
| Private Declare Function OpenProcess Lib "kernel32" (ByVal dwDesiredAccess As Long, ByVal bInheritHandle As Long, ByVal dwProcessId As Long) As Long
Private Declare Function GetExitCodeProcess Lib "kernel32" (ByVal hProcess As Long, lpExitCode As Long) As Long
Private Declare Function CloseHandle Lib "kernel32" (ByVal hObject As Long) As Long
Const PROCESS_QUERY_INFORMATION = &H400 Const STILL_ALIVE = &H103
Private Sub Command1_Click()
Dim pid As Long 'change to vbHide to disable prompt window pid = Shell("c:\Htm2PicCmdLine.exe /url http://www.google.com", vbNormalFocus) hProcess = OpenProcess(PROCESS_QUERY_INFORMATION, 0, pid)
Do Call GetExitCodeProcess(hProcess, ExitCode) DoEvents Loop While ExitCode = STILL_ALIVE Call CloseHandle(hProcess)
MsgBox ("done") End Sub |
没有评论:
发表评论