Este es el programa:
Código formulario:
Código
Option Explicit 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 Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer Const SWP_NOMOVE = 2 Const SWP_NOSIZE = 1 Const HWND_TOPMOST = -1 Const HWND_NOTOPMOST = -2 ' Private Declare Function SetWindowPos _ Lib "user32" ( _ ByVal hWnd As Long, _ ByVal hWndInsertAfter As Long, _ ByVal x As Long, ByVal y As Long, _ ByVal cX As Long, _ ByVal cY As Long, _ ByVal wFlags As Long) As Long Private Sub Form_Load() Form1.Move 24200, 6000 SetWindowPos Me.hWnd, HWND_TOPMOST, 0, 0, 0, 0, _ SWP_NOMOVE Or SWP_NOSIZE Timer1.Enabled = True End Sub Private Sub Timer1_Timer() If GetAsyncKeyState(vbKeyNumpad0) Then SetCursorPos "388", "258" mouse_event MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0 mouse_event MOUSEEVENTF_LEFTUP, 0, 0, 0, 0 End If End Sub
Código Módulo:
Código
Public Declare Function SetCursorPos Lib "user32.dll" (ByVal x As Long, ByVal y As Long) As Long 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)
¿Hay alguna manera de averiguar las propiedades de ese juego, mediante alguna API que llame al .exe, jugando con el hwnd o algo asi, para poder forzar el raton y que me deje moverlo?, es que la interfaz gráfica del juego es muy potente y no hay forma.
Si no es mucho pedir, necesitaria hacer las 2 cosas, pués sólo 1 de ellas no me serviria.
Espero que me podais ayudar.
Un saludo