以文本方式查看主题
- Foxtable(狐表) (http://foxtable.com/bbs/index.asp)
-- 专家坐堂 (http://foxtable.com/bbs/list.asp?boardid=2)
---- [求助]菜单 (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=54742)
|
-- 作者:xokxiao
-- 发布时间:2014/8/4 2:02:00
-- [求助]菜单
这段代码: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编辑过]
|
-- 作者:land089
-- 发布时间:2014/8/4 2:06:00
--
哪来的代码,看看全局变量里面的东西!
|
-- 作者:xokxiao
-- 发布时间:2014/8/4 2:17:00
--
以下是引用land089在2014-8-4 2:06:00的发言: 哪来的代码,看看全局变量里面的东西!
全局变量里面没有东西
此主题相关图片如下:qq图片20140804021526.jpg
|
-- 作者:land089
-- 发布时间:2014/8/4 2:19:00
--
说错了全局代码!
|
-- 作者:xokxiao
-- 发布时间:2014/8/4 2:21:00
--
以下是引用land089在2014-8-4 2:19:00的发言: 说错了全局代码!
全局代码
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
[此贴子已经被作者于2014-8-4 2:21:51编辑过]
|
-- 作者:land089
-- 发布时间:2014/8/4 2:27:00
--
看看这个链接http://www.so.com/s?psid=188ef76f0aee547a6884f0d817a3d209&q=vb+mouse_event&pq=mouse_event&src=srp&fr=se_zoned
|
-- 作者:xokxiao
-- 发布时间:2014/8/4 2:46:00
--
以下是引用land089在2014-8-4 2:27:00的发言:看看这个链接
http://www.so.com/s?psid=188ef76f0aee547a6884f0d817a3d209&q=vb+mouse_event&pq=mouse_event&src=srp&fr=se_zoned
Private Declare Sub mouse_event Lib "user32" (ByVal dwFlags As Long, ByVal dx As Long, ByVal dy As Long, ByVal cButtons As Long, ByVal dwExtraInfo As Long) Private Const MOUSEEVENTF_LEFTDOWN = &H2 \'鼠标左键按下 Private Const MOUSEEVENTF_LEFTUP = &H4 \' 鼠标左键弹起 Private Const MOUSEEVENTF_MOVE = &H1 \' 鼠标移动 Private Const MOUSEEVENTF_RIGHTDOWN = &H8 \' 鼠标右键按下 Private Const MOUSEEVENTF_RIGHTUP = &H10 \' 鼠标右键弹起 Private Declare Function SetCursorPos Lib "user32" (ByVal X As Long, ByVal Y As Long) As Long \'获得鼠标 Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long \'移动鼠标 Private Type POINTAPI X As Long Y As Long End Type Private Sub Command1_Click() SetCursorPos 25, 30 mouse_event &H2 Or &H4, 0, 0, 0, 0 mouse_event &H2 Or &H4, 0, 0, 0, 0 End Sub
后面几个0又是什么意思
|
-- 作者:land089
-- 发布时间:2014/8/4 2:50:00
--
坐标!
|
-- 作者:xokxiao
-- 发布时间:2014/8/4 2:52:00
--
O!谢谢
|