導航:首頁 > 程序命令 > 滑鼠轉vb命令

滑鼠轉vb命令

發布時間:2025-01-15 07:51:42

❶ 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視頻攻擊器??

閱讀全文

與滑鼠轉vb命令相關的資料

熱點內容
鴻蒙系統如何解除app安裝限制 瀏覽:497
阿里雲伺服器應用鏡像選哪個 瀏覽:343
win7策略更新命令 瀏覽:299
android源碼分析之設計模式 瀏覽:294
qq郵箱上的文件怎麼解壓在電腦上 瀏覽:504
業余學python是如何掙錢的 瀏覽:416
方舟伺服器連接超時顯示什麼 瀏覽:226
php繪制emoji 瀏覽:35
安卓桌面工具怎麼刪除 瀏覽:54
外六角螺絲套頭演算法 瀏覽:838
程序員特殊招數是什麼意思 瀏覽:351
描述加密過程 瀏覽:844
我的世界如何開mod伺服器 瀏覽:904
人體寫生pdf 瀏覽:317
android簡訊驗證碼倒計時 瀏覽:641
排課走班源碼 瀏覽:222
程序員剛畢業去了小公司有發展嗎 瀏覽:92
速騰怎麼安裝安卓手機互聯 瀏覽:145
linux設備驅動程序代碼 瀏覽:301
伺服器的功耗怎麼看 瀏覽:652