elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado:


+  Foro de elhacker.net
|-+  Programación
| |-+  Programación General
| | |-+  .NET (C#, VB.NET, ASP)
| | | |-+  Programación Visual Basic (Moderadores: LeandroA, seba123neo)
| | | | |-+  [Ayuda] Simular un click del mause
0 Usuarios y 1 Visitante están viendo este tema.
Páginas: [1] Ir Abajo Respuesta Imprimir
Autor Tema: [Ayuda] Simular un click del mause  (Leído 2,644 veces)
Flamer


Desconectado Desconectado

Mensajes: 1.051


crack, crack y mas crack...


Ver Perfil WWW
[Ayuda] Simular un click del mause
« en: 9 Marzo 2015, 21:13 pm »

Hola amigos estoy intentando simular un click con el mause, ya lo intente con un script pero no se puede ya que es muy limitado y ahora lo intento desde vb6 este es el codigo que tengo:
Código
  1. Option Explicit
  2. Private Declare Function OpenProcess Lib "kernel32" (ByVal dwDesiredAccess As Long, ByVal bInheritHandle As Long, ByVal dwProcessId As Long) As Long
  3. Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
  4. Private Declare Function GetWindowThreadProcessId Lib "user32" (ByVal hwnd As Long, lpdwProcessId As Long) As Long
  5. Private Declare Function CloseHandle Lib "kernel32" (ByVal hObject As Long) As Long
  6. Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
  7.  
  8.  
  9. Private P_HANDLE As Long
  10. Private P_PID As Long
  11. Private Const PROCESS_ALL_ACCESS = &H1F0FFF
  12. ' constantes para SendMessage
  13. Private Const WM_LBUTTONDBLCLK As Long = &H203 ' izquierdo doble click
  14. Private Sub Command1_Click()
  15. If FindWindow(vbNullString, "BlueStacks App Player for Windows (beta-1)") Then
  16.   GetWindowThreadProcessId FindWindow(vbNullString, "BlueStacks App Player for Windows (beta-1)"), P_PID
  17.   P_HANDLE = OpenProcess(PROCESS_ALL_ACCESS, False, P_PID)
  18. End If
  19. Timer1.Interval = 500
  20. End Sub
  21. Private Sub Form_Unload(Cancel As Integer)
  22. CloseHandle P_HANDLE
  23. End Sub
  24.  
  25. Private Sub Timer1_Timer()
  26.    Call SendMessage(P_HANDLE, WM_LBUTTONDBLCLK, 1, ByVal 0&)
  27. End Sub
  28.  

saludos flamer y haber quien me hecha una mano


« Última modificación: 9 Marzo 2015, 21:15 pm por Flamer » En línea

Mi Canal De Youtube y Blog

https://elblogdeflamer.blogspot.com

Miseryk

Desconectado Desconectado

Mensajes: 225


SI.NU.SA U.GU.DE (2NE1 - D-Unit)


Ver Perfil
Re: [Ayuda] Simular un click del mause
« Respuesta #1 en: 10 Marzo 2015, 14:13 pm »

Hola amigos estoy intentando simular un click con el mause, ya lo intente con un script pero no se puede ya que es muy limitado y ahora lo intento desde vb6 este es el codigo que tengo:
Código
  1. Option Explicit
  2. Private Declare Function OpenProcess Lib "kernel32" (ByVal dwDesiredAccess As Long, ByVal bInheritHandle As Long, ByVal dwProcessId As Long) As Long
  3. Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
  4. Private Declare Function GetWindowThreadProcessId Lib "user32" (ByVal hwnd As Long, lpdwProcessId As Long) As Long
  5. Private Declare Function CloseHandle Lib "kernel32" (ByVal hObject As Long) As Long
  6. Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
  7.  
  8.  
  9. Private P_HANDLE As Long
  10. Private P_PID As Long
  11. Private Const PROCESS_ALL_ACCESS = &H1F0FFF
  12. ' constantes para SendMessage
  13. Private Const WM_LBUTTONDBLCLK As Long = &H203 ' izquierdo doble click
  14. Private Sub Command1_Click()
  15. If FindWindow(vbNullString, "BlueStacks App Player for Windows (beta-1)") Then
  16.   GetWindowThreadProcessId FindWindow(vbNullString, "BlueStacks App Player for Windows (beta-1)"), P_PID
  17.   P_HANDLE = OpenProcess(PROCESS_ALL_ACCESS, False, P_PID)
  18. End If
  19. Timer1.Interval = 500
  20. End Sub
  21. Private Sub Form_Unload(Cancel As Integer)
  22. CloseHandle P_HANDLE
  23. End Sub
  24.  
  25. Private Sub Timer1_Timer()
  26.    Call SendMessage(P_HANDLE, WM_LBUTTONDBLCLK, 1, ByVal 0&)
  27. End Sub
  28.  

saludos flamer y haber quien me hecha una mano

Por ahora encontré como enviar MOUSEDOWN y MOUSEUP y funcionan, no logré el click común pero ésto sería casi lo mismo, y el doble click tendría que verlo.

Código
  1. Option Explicit
  2.  
  3. Private Const WM_LBUTTONDOWN As Long = &H201
  4. Private Const WM_LBUTTONUP As Long = &H202
  5. Private Const MK_LBUTTON As Long = &H1&
  6.  
  7. Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
  8.  
  9. Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
  10.  
  11. Private Sub SimClick(ByVal windowHwnd As Long, ByVal PosX As Integer, ByVal PosY As Integer)
  12. SendMessage windowHwnd, WM_LBUTTONDOWN, MK_LBUTTON, MakeDWord(PosX, PosY)
  13. SendMessage windowHwnd, WM_LBUTTONUP, 0, MakeDWord(PosX, PosY)
  14. End Sub
  15.  
  16. Private Function MakeDWord(ByVal LoWord As Integer, ByVal HiWord As Integer) As Long
  17. MakeDWord = (HiWord * &H10000) Or (LoWord And &HFFFF&)
  18. End Function
  19.  
  20. Private Sub Command1_Click()
  21. Dim hwnd As Long
  22.  
  23. hwnd = FindWindow(vbNullString, "CLICKME")
  24.  
  25. Call SimClick(hwnd, CInt(50), CInt(50))
  26. End Sub
  27.  


En línea

Can you see it?
The worst is over
The monsters in my head are scared of love
Fallen people listen up! It’s never too late to change our luck
So, don’t let them steal your light
Don’t let them break your stride
There is light on the other side
And you’ll see all the raindrops falling behind
Make it out tonight
it’s a revolution

CL!!!
Miseryk

Desconectado Desconectado

Mensajes: 225


SI.NU.SA U.GU.DE (2NE1 - D-Unit)


Ver Perfil
Re: [Ayuda] Simular un click del mause
« Respuesta #2 en: 10 Marzo 2015, 15:28 pm »

Acá tenés el doble click.

Código
  1. Option Explicit
  2.  
  3. ' función SendMessage
  4. Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" ( _
  5.    ByVal hwnd As Long, _
  6.    ByVal wMsg As Long, _
  7.    ByVal wParam As Long, _
  8.    ByVal lParam As Long) As Long
  9. Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
  10.  
  11. Private Const WM_LBUTTONDBLCLK As Long = &H203
  12.  
  13. Private Function MakeDWord(ByVal LoWord As Integer, ByVal HiWord As Integer) As Long
  14. MakeDWord = (HiWord * &H10000) Or (LoWord And &HFFFF&)
  15. End Function
  16.  
  17. Public Sub SimDobleClick(ByVal hwnd As Long, ByVal PosX As Integer, ByVal PosY As Integer)
  18. Call SendMessage(hwnd, WM_LBUTTONDBLCLK, 0, MakeDWord(PosX, PosY))
  19. End Sub
  20.  
  21. Private Sub Command1_Click()
  22. Call SimDobleClick(FindWindow(vbNullString, "CLICKME"), 100, 100)
  23. End Sub
  24.  
En línea

Can you see it?
The worst is over
The monsters in my head are scared of love
Fallen people listen up! It’s never too late to change our luck
So, don’t let them steal your light
Don’t let them break your stride
There is light on the other side
And you’ll see all the raindrops falling behind
Make it out tonight
it’s a revolution

CL!!!
Flamer


Desconectado Desconectado

Mensajes: 1.051


crack, crack y mas crack...


Ver Perfil WWW
Re: [Ayuda] Simular un click del mause
« Respuesta #3 en: 11 Marzo 2015, 05:49 am »

hola amigo ya lo solucione en el mismo dia...

Pero doy gracias  alos 2 por el apoyo

bueno saludos flamer y gracias
En línea

Mi Canal De Youtube y Blog

https://elblogdeflamer.blogspot.com

Páginas: [1] Ir Arriba Respuesta Imprimir 

Ir a:  

Mensajes similares
Asunto Iniciado por Respuestas Vistas Último mensaje
[Duda] Cual es el Valor de de Mause right click down y Mause right click up
Programación Visual Basic
agus0 2 2,781 Último mensaje 15 Julio 2009, 20:48 pm
por agus0
Simular click de raton
.NET (C#, VB.NET, ASP)
Gorky 7 11,764 Último mensaje 11 Septiembre 2009, 05:01 am
por Zzombi
Como dar un mensaje falso cada vez que se hace click con el mause
Programación Visual Basic
Otaku=) 5 2,502 Último mensaje 28 Septiembre 2010, 03:10 am
por Otaku=)
Simular Click « 1 2 »
Programación Visual Basic
ignorantev1.1 19 9,164 Último mensaje 2 Diciembre 2011, 09:21 am
por BlackZeroX
[Ayuda] Simular un click del mause con sendkeys vbKeyLButton
Scripting
Flamer 3 4,877 Último mensaje 9 Marzo 2015, 20:52 pm
por Eleкtro
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines