- ©«¤l
- 172
- ¥DÃD
- 39
- ºëµØ
- 20
- ¿n¤À
- 177
- ÂI¦W
- 0
- §@·~¨t²Î
- Microsoft Windows XP
- ³nÅ骩¥»
- Microsoft Office 2003
- ¾\ŪÅv
- 100
- ©Ê§O
- ¨k
- ¨Ó¦Û
- °ª¶¯
- µù¥U®É¶¡
- 2010-5-1
- ³Ì«áµn¿ý
- 2023-3-19
|
[¤À¨É] Åýµ{¦¡µ¥«Ý¦Ü¤W¤@Ó¶}±Òªº°õ¦æµ{¦¡µ²§ô
¥»©«³Ì«á¥Ñ Min ©ó 2010-5-3 23:03 ½s¿è
Option Explicit
Declare Function OpenProcess Lib "kernel32" (ByVal dwDesiredAccess As Long, ByVal bInheritHandle As Long, ByVal dwProcessId As Long) As Long
Declare Function CloseHandle Lib "kernel32" (ByVal hObject As Long) As Long
Declare Function WaitForSingleObject Lib "kernel32" (ByVal hHandle As Long, ByVal dwMilliseconds As Long) As Long
Public Const SYNCHRONIZE = &H100000
Public Const INFINITE = &HFFFFFFFF
Sub WaitProcess()
Dim Pid As String
Dim pHnd As String
Pid = Shell("C:\Windows\system32\notepad.exe", vbNormalFocus) ' Shell ¶Ç¦^ Process Id
pHnd = OpenProcess(SYNCHRONIZE, 0, Pid) ' ¨ú±o Process Handle
If pHnd <> 0 Then
Call WaitForSingleObject(pHnd, INFINITE) ' µLµ¥«Ý¡Aª½¨ìµ{¦¡µ²§ô
DoEvents '¼È°±°õ¦æ¡A¥H«KÅý§@·~¨t²Î¥i¥H³B²z¨ä¥¦ªº¨Æ¥ó¡C
Call CloseHandle(pHnd)
End If
End Sub |
|