VB里捕抓鼠标左击所在位置(在网业里)

来源:百度知道 编辑:UC知道 时间:2024/09/28 14:40:08
启动软件以后 当鼠标在网业里点击时 记录所在位置 (可以的话 固定网业位置)
我要记录鼠标点击时的所在位置
就是监控鼠标

新建VB工程,添加一个Timer控件,以下代码可以实时记录你鼠标所在的位置:
Private Type POINTAPI
x As Long
y As Long
End Type
Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long

Private Sub Form_Load()
Timer1.Interval = 10
End Sub

Private Sub Timer1_Timer()
Dim A As POINTAPI
Call GetCursorPos(A) '取得鼠标位置
Me.Caption = "X坐标:" & A.x & "══Y坐标:" & A.y
End Sub

这个我不太清楚,你可以网上找找看!http://blog.denglijun.tw/post/27.html