Manual Como hacer para mover el mouse y hacer click en vb

Iniciado por gmf_321, 24 Septiembre 2006, 16:31 PM

0 Miembros y 1 Visitante están viendo este tema.

gmf_321

Para cambiar de posicion el mouse van a usar la siguiente api:
Public Declare Function SetCursorPos Lib "user32.dll" (ByVal x As Long, ByVal y As Long) As Long
Para hacer click con el mouse van a usar la siguiente api:
Public Declare Sub mouse_event Lib "user32.dll" (ByVal dwFlags As Long, ByVal dx As Long, ByVal dy _
    As Long, ByVal cButtons As Long, ByVal dwExtraInfo As Long)

Constantes del mouse_event
Const MOUSEEVENTF_ABSOLUTE = &H8000
Const MOUSEEVENTF_LEFTDOWN = &H2
Const MOUSEEVENTF_LEFTUP = &H4
Const MOUSEEVENTF_MIDDLEDOWN = &H20
Const MOUSEEVENTF_MIDDLEUP = &H40
Const MOUSEEVENTF_MOVE = &H1
Const MOUSEEVENTF_RIGHTDOWN = &H8
Const MOUSEEVENTF_RIGHTUP = &H10
Const MOUSEEVENTF_WHEEL = &H80
Const MOUSEEVENTF_XDOWN = &H100
Const MOUSEEVENTF_XUP = &H200
Const WHEEL_DELTA = 120
Const XBUTTON1 = &H1
Const XBUTTON2 = &H2


Para hacer click pone este code (boton izquierdo del mouse):
mouse_event MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0
    mouse_event MOUSEEVENTF_LEFTUP, 0, 0, 0, 0

Despues para mover el mouse :
SetCursorPos("x", "y")

                                Saludos FMG ......
1. La vanidad y la avaricia son dos pecados capitales, por lo que un verdadero hacker no hackea por ganar dinero o fama.
2. Odia a Telefónica pero no te metas con ella
3. No hackees sistemas pobres que no puedan reponerse de un ataque fuerte. Ni tampoco sistemas muy ricos o grandes que puedan permitirse gastar dinero y tiempo en buscarte.

Dahmer