- Код: Выделить всё
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 mabsolute = &H8000 ' absolute move
Private Const lmbdown = &H2 ' left button down
Private Const lmbup = &H4 ' left button up
Private Const mmbdown = &H20 ' middle button down
Private Const mmbup = &H40 ' middle button up
Private Const mmove = &H1 ' mouse move
Private Const rmbdown = &H8 ' right button down
Private Const rmbup = &H10 ' right button up
Private Sub Command1_Click()
movemouseto 790, 600
End Sub
Public Sub movemouseto(x As Long, y As Long)
Dim x1, y1 As Long
x1 = x * 65535 / Screen.Width
y1 = y * 65535 / Screen.Height
mouse_event (mmove + mabsolute), x1, y1, 0, 0
End Sub