❶ VB中滑鼠指針反轉
呵呵,學習下,基本上我認為很難,但是我有個思路,說出來同樓主研究下,在窗體上畫一個圖片,圖片的樣子就是滑鼠指針的樣子,然後通過滑鼠移動事件來寫代碼。如果滑鼠在窗體上移動的話。(x<form1.width x>0 y<form1.height y>0) 圖片就顯現出來並移動到坐標 (left=form1.width-x,top=form1.height-y)同是把真正的滑鼠給敝屏。(怎麼弊屏我真不會)大約就是這個意思。下面有個用按鈕代替圖片的代碼。供你參考一下下,如果樓主你找到方法請貼一下。我也想知道。呵呵
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
Label1 = x & ": " & y
Command1.Left = Form1.Width - x
Command1.Top = Form1.Height - y
兄弟啊,為你這個問題我想了一個晚上,突然在半夜睡覺的夢里想出了一個解決方法,今天試了試。成了,呵呵,保證和你的題目是一樣的。代碼有點多,如果不懂HI我吧。。。
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_MOVE = &H1 'Mouse move
Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long 'move 坐標
Private Declare Function SetCursorPos Lib "user32" (ByVal x As Long, ByVal y As Long) As Long '移動
Private Type POINTAPI '定義點(Point)結構
x As Long '點在X坐標(橫坐標)上的坐標值
y As Long '點在Y坐標(縱坐標)上的坐標值
End Type
Dim fafa1x As Long
Dim fafa1y As Long
Dim fafa2x As Long
Dim fafa2y As Long
Dim fa1 As Boolean
Dim fa2 As Boolean
Private Sub Form_Click()
Timer1.Interval = 2 '設置時鍾可以自己調,根據你的移動速度來
End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
fa2 = True '是否在窗體上移動
If fa1 = True Then '新坐標
Dim dl As Long
Dim mypoint As POINTAPI
dl& = GetCursorPos(mypoint)
fafa2x = mypoint.x
fafa2y = mypoint.y
SetCursorPos fafa1x + (fafa1x - fafa2x) * 2, fafa1y + (fafa1y - fafa2y) * 2 '反向移動
fa2 = False '防止滑鼠跳出窗體後出錯
fa1 = False '開始計時器
End If
End Sub
Private Sub Timer1_Timer()
If fa1 = False And fa2 = True Then
Dim dl As Long
Dim mypoint As POINTAPI
dl& = GetCursorPos(mypoint) '調用函數,獲取屏幕滑鼠坐標
fafa1x = mypoint.x
fafa1y = mypoint.y
fa1 = True '開始讀取新坐標
End If
Label1 = mypoint.x & " : " & mypoint.y
End Sub
End Sub
❷ vb 控制滑鼠按要求移動。
按照時間間隔分次執行的話可以用TImer控制項來控制,你在做QQ視頻攻擊器??