Private Declare Function GetCursorInfo Lib "user32 " (pci As CURSORINFO) As Long
'获取系统内当前鼠标的信息
Private Type POINTAPI '代表鼠标指针当前位置的一个结构
X As Long
Y As Long
End Type
Dim lastcur As Long
Private Type CURSORINFO '获得鼠标信息内容
cbSize As Long '本结构大小
flags As Long '附加参数
hCursor As Long '获取的鼠标句丙
ptScreenPos As POINTAPI '鼠标当前的坐标
End Type
Private Sub Timer1_Timer()
Dim CursorPar As CURSORINFO
CursorPar.cbSize = Len(CursorPar)
GetCursorInfo CursorPar
Text1.Text = CursorPar.hCursor
End Sub
VB代码:监控系统鼠标指针的变化
最新推荐文章于 2023-04-06 11:12:37 发布