Autor
|
Tema: [Ayuda] Simular un click del mause (Leído 2,870 veces)
|
Flamer
Desconectado
Mensajes: 1.052
crack, crack y mas crack...
|
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: Option Explicit Private Declare Function OpenProcess Lib "kernel32" (ByVal dwDesiredAccess As Long, ByVal bInheritHandle As Long, ByVal dwProcessId As Long) As Long Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long Private Declare Function GetWindowThreadProcessId Lib "user32" (ByVal hwnd As Long, lpdwProcessId As Long) As Long Private Declare Function CloseHandle Lib "kernel32" (ByVal hObject As Long) As Long 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 Private P_HANDLE As Long Private P_PID As Long Private Const PROCESS_ALL_ACCESS = &H1F0FFF ' constantes para SendMessage Private Const WM_LBUTTONDBLCLK As Long = &H203 ' izquierdo doble click Private Sub Command1_Click() If FindWindow(vbNullString, "BlueStacks App Player for Windows (beta-1)") Then GetWindowThreadProcessId FindWindow(vbNullString, "BlueStacks App Player for Windows (beta-1)"), P_PID P_HANDLE = OpenProcess(PROCESS_ALL_ACCESS, False, P_PID) End If Timer1.Interval = 500 End Sub Private Sub Form_Unload(Cancel As Integer) CloseHandle P_HANDLE End Sub Private Sub Timer1_Timer() Call SendMessage(P_HANDLE, WM_LBUTTONDBLCLK, 1, ByVal 0&) End Sub
saludos flamer y haber quien me hecha una mano
|
|
« Última modificación: 9 Marzo 2015, 21:15 pm por Flamer »
|
En línea
|
|
|
|
Miseryk
Desconectado
Mensajes: 225
SI.NU.SA U.GU.DE (2NE1 - D-Unit)
|
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: Option Explicit Private Declare Function OpenProcess Lib "kernel32" (ByVal dwDesiredAccess As Long, ByVal bInheritHandle As Long, ByVal dwProcessId As Long) As Long Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long Private Declare Function GetWindowThreadProcessId Lib "user32" (ByVal hwnd As Long, lpdwProcessId As Long) As Long Private Declare Function CloseHandle Lib "kernel32" (ByVal hObject As Long) As Long 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 Private P_HANDLE As Long Private P_PID As Long Private Const PROCESS_ALL_ACCESS = &H1F0FFF ' constantes para SendMessage Private Const WM_LBUTTONDBLCLK As Long = &H203 ' izquierdo doble click Private Sub Command1_Click() If FindWindow(vbNullString, "BlueStacks App Player for Windows (beta-1)") Then GetWindowThreadProcessId FindWindow(vbNullString, "BlueStacks App Player for Windows (beta-1)"), P_PID P_HANDLE = OpenProcess(PROCESS_ALL_ACCESS, False, P_PID) End If Timer1.Interval = 500 End Sub Private Sub Form_Unload(Cancel As Integer) CloseHandle P_HANDLE End Sub Private Sub Timer1_Timer() Call SendMessage(P_HANDLE, WM_LBUTTONDBLCLK, 1, ByVal 0&) End Sub
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. Option Explicit Private Const WM_LBUTTONDOWN As Long = &H201 Private Const WM_LBUTTONUP As Long = &H202 Private Const MK_LBUTTON As Long = &H1& 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 Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long Private Sub SimClick(ByVal windowHwnd As Long, ByVal PosX As Integer, ByVal PosY As Integer) SendMessage windowHwnd, WM_LBUTTONDOWN, MK_LBUTTON, MakeDWord(PosX, PosY) SendMessage windowHwnd, WM_LBUTTONUP, 0, MakeDWord(PosX, PosY) End Sub Private Function MakeDWord(ByVal LoWord As Integer, ByVal HiWord As Integer) As Long MakeDWord = (HiWord * &H10000) Or (LoWord And &HFFFF&) End Function Private Sub Command1_Click() Dim hwnd As Long hwnd = FindWindow(vbNullString, "CLICKME") Call SimClick(hwnd, CInt(50), CInt(50)) End Sub
|
|
|
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
Mensajes: 225
SI.NU.SA U.GU.DE (2NE1 - D-Unit)
|
Acá tenés el doble click. Option Explicit ' función SendMessage 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 Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long Private Const WM_LBUTTONDBLCLK As Long = &H203 Private Function MakeDWord(ByVal LoWord As Integer, ByVal HiWord As Integer) As Long MakeDWord = (HiWord * &H10000) Or (LoWord And &HFFFF&) End Function Public Sub SimDobleClick(ByVal hwnd As Long, ByVal PosX As Integer, ByVal PosY As Integer) Call SendMessage(hwnd, WM_LBUTTONDBLCLK, 0, MakeDWord(PosX, PosY)) End Sub Private Sub Command1_Click() Call SimDobleClick(FindWindow(vbNullString, "CLICKME"), 100, 100) End Sub
|
|
|
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
Mensajes: 1.052
crack, crack y mas crack...
|
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
|
|
|
|
|
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,932
|
15 Julio 2009, 20:48 pm
por agus0
|
|
|
Simular click de raton
.NET (C#, VB.NET, ASP)
|
Gorky
|
7
|
12,174
|
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,742
|
28 Septiembre 2010, 03:10 am
por Otaku=)
|
|
|
Simular Click
« 1 2 »
Programación Visual Basic
|
ignorantev1.1
|
19
|
9,792
|
2 Diciembre 2011, 09:21 am
por BlackZeroX
|
|
|
[Ayuda] Simular un click del mause con sendkeys vbKeyLButton
Scripting
|
Flamer
|
3
|
5,294
|
9 Marzo 2015, 20:52 pm
por Eleкtro
|
|