VB如何判断鼠标是否在移动

来源:百度知道 编辑:UC知道 时间:2024/05/29 21:34:01
想做一个系统的屏保工具一样的程序!就是检测当前系统鼠标是否在移动,不管在哪个程序上活动,只要一停下来就启动一个事件!

Private Type POINTAPI
x As Long
y As Long
End Type

Private Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type

Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long

Dim t As POINTAPI
GetCursorPos t
'鼠标位置
Form1.text1.Text = t.x
Form1.text2.Text = t.y