这段代码:mouse_event(&H2 Or &H4,0,0,0,0)是华海仓库管理系统1.0菜单里的
MouseEnter
鼠标进入控件的时候执行。
e参数属性:
Sender:返回触发事件的控件
Form: 返回控件所在的窗口
全局代码
Public Declare Sub mouse_event Lib "user32" Alias "mouse_event" (ByVal dwFlags As Integer, ByVal dx As Integer, ByVal dy As Integer, ByVal cButtons As Integer, ByVal dwExtraInfo As Integer)
'定时锁
Public Declare Function GetLastInputInfo Lib "user32.dll" (ByRef plii As LASTINPUTINFO) As Integer
Public Declare Function GetTickCount Lib "kernel32" Alias "GetTickCount" () As Integer
Public Structure LASTINPUTINFO
Dim cbSize As Int32
Dim dwTime As Int32
End Structure
Public Function Tick() As Double
Dim lii As LASTINPUTINFO
lii.cbSize = Len(lii)
If GetLastInputInfo(lii) Then
Return GetTickCount - lii.dwTime
End If
End Function
此主题相关图片如下:111.jpg
[此贴子已经被作者于2014-8-4 2:30:01编辑过]