不一定要用这个
Private Declare Function SetCursorPos Lib "user32" (ByVal a As Long, ByVal b As Long) As Long
Private Sub Form_Load()
SetCursorPos 100, 100
End Sub
这个是移动鼠标
Private Declare Sub mouse_event Lib "user32" (ByVal a As Long, ByVal b As Long, ByVal c As Long, ByVal d As Long, ByVal e As Long)
Private Sub Form_Load()
mouse_event &H2, 0, 0, 0, 0
End Sub
&H2是参数
&H2代表按住鼠标左键
&H4代表松开鼠标左键
&H8代表按住鼠标右键
&H10代表松开鼠标右键
涉及到后台操作,必须用postmessage 如能解决,可以加更多分~ 谁能帮我实现一个在VB中webbrowser控件的鼠标手势功能,或者是用一个按钮点Dim h
Private Declare Function PostMessage Lib "user32" Alias "PostMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
Private Const WM_LBUTTONDOWN = &H201
Private Const WM_LBUTTONUP = &H202
Private Sub Command1_Click()
MsgBox "123"
End Sub
Private Sub Command2_Click()
PostMessage Command1.hwnd, WM_LBUTTONDOWN, 0, 0
PostMessage Command1.hwnd, WM_LBUTTONUP, 0, 0
End Sub