vb 鼠标问题
好像spy++上面的圆圈一样按下鼠标后就跟随鼠标走动同志我说的不是窗体内的跟随我说的是在其他应用程序中也可以的api函数也不是鼠标跟随我就是想实现spy++的效果...
好像 spy++ 上面的圆圈一样 按下鼠标后 就跟随鼠标走动
同志 我说的不是窗体内的跟随 我说的是在其他应用程序中也可以 的api函数
也不是鼠标跟随 我就是想实现 spy++的效果 展开
同志 我说的不是窗体内的跟随 我说的是在其他应用程序中也可以 的api函数
也不是鼠标跟随 我就是想实现 spy++的效果 展开
展开全部
那是用三幅图实现,需要可联系
Private Sub Picture1_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
Picture1.Picture = LoadPicture("空白图")
Screen.MousePointer = vbCustom
Screen.MouseIcon = LoadPicture("指针图")
SetCapture (Picture1.hwnd)
End Sub
Private Sub Picture1_MouseUp(Button As Integer, Shift As Integer, x As Single, y As Single)
Picture1.Picture = LoadPicture("完整图")
Screen.MousePointer = vbDefault
End Sub
Private Sub Picture1_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
Picture1.Picture = LoadPicture("空白图")
Screen.MousePointer = vbCustom
Screen.MouseIcon = LoadPicture("指针图")
SetCapture (Picture1.hwnd)
End Sub
Private Sub Picture1_MouseUp(Button As Integer, Shift As Integer, x As Single, y As Single)
Picture1.Picture = LoadPicture("完整图")
Screen.MousePointer = vbDefault
End Sub
展开全部
用GetCursorPos
Public Declare Function GetCursorPos Lib "user32" Alias "GetCursorPos" (lpPoint As POINTAPI) As Long
Public Type POINTAPI
x As Long
y As Long
End Type
然后获取鼠标位置:
Dim a As POINTAPI
Call GetCursorPos(a)
a.x 为x坐标,a.y为y坐标 你可以 Debug.Print a.x & " " & a.y 从调试窗口中看到鼠标的坐标。
Public Declare Function GetCursorPos Lib "user32" Alias "GetCursorPos" (lpPoint As POINTAPI) As Long
Public Type POINTAPI
x As Long
y As Long
End Type
然后获取鼠标位置:
Dim a As POINTAPI
Call GetCursorPos(a)
a.x 为x坐标,a.y为y坐标 你可以 Debug.Print a.x & " " & a.y 从调试窗口中看到鼠标的坐标。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询