怎样用API取代回调函数,回调函数太容易出错了
我想用GetMessage,但是结果却不是这样,这是我的源码Private Declare Function GetMessage Lib "user32" Alias "GetMessageA" (lpMsg As MSG, ByVal hwnd As Long, ByVal wMsgFilterMin As Long, ByVal wMsgFilterMax As Long) As Long
Private Type MSG
hwnd As Long
message As Long
wParam As Long
lParam As Long
time As Long
pt As POINTAPI
End Type
Private Sub Timer1_Timer()
Dim ISmsg As MSG
Call GetMessage(ISmsg, Me.hwnd, 0, 0)
If ISmsg.message = WM_DROPFILES Then MsgBox "s"
End Sub
我想用GetMessage,但是结果却不是这样,这是我的源码Private Declare Function GetMessage Lib "user32" Alias "GetMessageA" (lpMsg As MSG, ByVal hwnd As Long, ByVal wMsgFilterMin As Long, ByVal wMsgFilterMax As Long) As Long
Private Type MSG
hwnd As Long
message As Long
wParam As Long
lParam As Long
time As Long
pt As POINTAPI
End Type
Private Sub Timer1_Timer()
Dim ISmsg As MSG
Call GetMessage(ISmsg, Me.hwnd, 0, 0)
If ISmsg.message = WM_DROPFILES Then MsgBox "s"
End Sub
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货