evb 里面不支持DoEvents,我在www.devbuzz.com里面找到了答案
'Listing 1 - DoEventsCE
Declare Function PeekMessage Lib "coredll.dll" Alias "PeekMessageW" _
(ByVal MSG As String, ByVal hwnd As Long, ByVal wMsgFilterMin As Integer, _
ByVal wMsgFilterMax As Integer, ByVal wRemoveMsg As Integer) As Boolean
Declare Function TranslateMessage Lib "coredll.dll" (ByVal MSG As String) As Boolean
Declare Function DispatchMessage Lib "coredll.dll" Alias "DispatchMessageW" _
(ByVal MSG As String) As Boolean
Public Const PM_REMOVE = 1
'Enof Listing 1 - DoEventsCE
Public Sub DoEventsCE()
Dim MSG As String
MSG = String(18, Chr(0))
' Get message from queue and dispatch it
If PeekMessage(MSG, 0, 0, 0, PM_REMOVE) Then
TranslateMessage (MSG)
DispatchMessage (MSG)
End If
End Sub
'Listing 1 - DoEventsCE
Declare Function PeekMessage Lib "coredll.dll" Alias "PeekMessageW" _
(ByVal MSG As String, ByVal hwnd As Long, ByVal wMsgFilterMin As Integer, _
ByVal wMsgFilterMax As Integer, ByVal wRemoveMsg As Integer) As Boolean
Declare Function TranslateMessage Lib "coredll.dll" (ByVal MSG As String) As Boolean
Declare Function DispatchMessage Lib "coredll.dll" Alias "DispatchMessageW" _
(ByVal MSG As String) As Boolean
Public Const PM_REMOVE = 1
'Enof Listing 1 - DoEventsCE
Public Sub DoEventsCE()
Dim MSG As String
MSG = String(18, Chr(0))
' Get message from queue and dispatch it
If PeekMessage(MSG, 0, 0, 0, PM_REMOVE) Then
TranslateMessage (MSG)
DispatchMessage (MSG)
End If
End Sub