|
楼主 |
发表于 2009-4-22 19:45
|
显示全部楼层
回复 8楼 小fisher 的帖子
Private Function WindowProc(ByVal hwnd As Long, ByVal Msg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
Debug.Print Hex(Msg)
Select Case Msg
Case WM_MOUSEMOVE
If Not bMouseIn Then
UserForm1.MouseEnter
bMouseIn = True
End If
Dim tme As TrackMouseEvent
tme.cbSize = Len(tme)
tme.dwFlags = TME_LEAVE
tme.dwHoverTime = 100
tme.hwndTrack = hwnd
TrackMouseEvent tme
Case WM_MOUSELEAVE
UserForm1.MouseLeave
bMouseIn = False
End Select
WindowProc = CallWindowProc(lOldProc, hwnd, Msg, wParam, lParam)
End Function
调用测试,说UserForm1没有指定对象?是咋回事??我把实例的代码copy的相应的模块,窗口打开,鼠标指向窗口点击就窗口就不动了,死机一般,必须强行关闭文件才行。 |
|