hacker


Ingresar con nombre de usuario, contraseña y duración de la sesión
| Portal Hacker | Editorial | Descargas | Ezine |
Inicio Ayuda Ingresar Registrarse
21 de Agosto de 2008, 09:17:56
Noticias: La 1era E-Zine de CPH ya fue liberada, encuentrala
Para ver este enlace Registrate o Inicia Sesion
> aquí

+  Foros pOrtal Hacker
|-+  Programacion
| |-+  Programación en general
| | |-+  Visual Basic (Moderadores: ranefi, crypto136, ziBboh, >> s E t H <<)
| | | |-+  Ayuda con AutoClic
0 Usuarios y 1 Visitante están viendo este tema. « anterior próximo »
Páginas: [1] Ir Abajo Imprimir
Autor Tema: Ayuda con AutoClic  (Leído 1160 veces)
Levias
Recien llegado
*
Desconectado Desconectado

Mensajes: 1


Ver Perfil
« : 17 de Noviembre de 2006, 12:59:07 »

Holas, la verdad es que soy muy nuevo en este foro XD, mi primer post  Sad, bueno es que queria saver si hay alguna funcion que permita hacer un "autocliker", osea q simule q se aprieta un click en cualquier lugar de la pantalla, (Me refiero fuera del programa).

Les agradeceria mucho si me respondieran ya que soy nuevito y quero aprender muchooooo, ya que todos partimos de abajo =P..

Tau

PD: Si no es mucho pedir que pongan codigo con explicacion, pa cachar algo xD.
« Última modificación: 24 de Noviembre de 2006, 09:42:52 por Levias » En línea
ranefi
Moderador Global
*****
Desconectado Desconectado

Mensajes: 1,193


SELECT * FROM guapos WHERE papito_chulo = 'ranefi'


Ver Perfil WWW
« Respuesta #1 : 24 de Noviembre de 2006, 09:22:02 »

Holas, la verdad es que soy muy nuevo en este foro XD, mi primer post  Sad, bueno es que queria saver si hay alguna funcion que permita hacer un "autocliker", osea q simule q se aprieta un click en cualquier lugar de la pantalla, (Me refiero fuera del programa).

Les agradeceria mucho si me respondieran ya que soy nuevito y quero aprender muchooooo, ya que todos partimos de abajo =P..

Tau

PD: Si no es mucho pedir que pongan codigo con explicacion, pa cachar algo xD.

Borren el Tema plz, otro usuario posteo algo parecido y ally encontre mi respuesta

Buen día Levias y bienvenido al foro. Aquí te dejo el código que necesitas.

Agregar 1 control CommandButton e insertar el siguiente código en un...

Formulario
Código:


Private Type POINTAPI
    x As Long
    y As Long
End Type

Private Type RECT
    Left As Long
    Top As Long
    Right As Long
    Bottom As Long
End Type

Private Declare Function GetMenu Lib "user32" _
    (ByVal hwnd As Long) As Long

Private Declare Function GetMenuItemRect Lib "user32" _
    (ByVal hwnd As Long, ByVal hMenu As Long, ByVal uItem As Long, _
    lprcItem As RECT) As Long

Private Declare Function GetSubMenu Lib "user32" _
    (ByVal hMenu As Long, ByVal nPos As Long) As Long

Private Const MOUSEEVENTF_ABSOLUTE = &H8000 ' absolute move
Private Const MOUSEEVENTF_LEFTDOWN = &H2 ' left button down
Private Const MOUSEEVENTF_LEFTUP = &H4 ' left button up
Private Const MOUSEEVENTF_MOVE = &H1 ' mouse move
Private Const MOUSEEVENTF_MIDDLEDOWN = &H20
Private Const MOUSEEVENTF_MIDDLEUP = &H40
Private Const MOUSEEVENTF_RIGHTDOWN = &H8
Private Const MOUSEEVENTF_RIGHTUP = &H10

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 Declare Function GetMessageExtraInfo Lib "user32" () As Long

Private Declare Function GetSystemMetrics Lib "user32" _
    (ByVal nIndex As Long) As Long

Const SM_CXSCREEN = 0 'X Size of screen
Const SM_CYSCREEN = 1 'Y Size of Screen

Private Sub Command1_Click()
    Dim mWnd As Long, p As POINTAPI
    Dim hMenu As Long, hSubMenu As Long
   
    mWnd = Me.hwnd
    hMenu = GetMenu(mWnd) 'Get the Menu of the Window(MenuBar)

    ClickMenuItem mWnd, hMenu, 0 'Click on the first SubMenu
    hSubMenu = GetSubMenu(hMenu, 0) 'Get its submenu
    ClickMenuItem mWnd, hSubMenu, 0 'Click on the first MenuItem of the Submenu

    p.x = &HFFFF& / 2
    p.y = &HFFFF& / 2

    Click p

    Me.AutoRedraw = True
    Me.BackColor = vbWhite

    Print "Diste clic"
End Sub

Private Sub Form_KeyPress(KeyAscii As Integer)
    Dim mWnd As Long
   
    mWnd = Me.hwnd
   
    Dim hMenu As Long, hSubMenu As Long

    hMenu = GetMenu(mWnd) 'Get the Menu of the Window(MenuBar)
   
    ClickMenuItem mWnd, hMenu, 0 'Click on the first SubMenu
   
    hSubMenu = GetSubMenu(hMenu, 0) 'Get its submenu
   
    ClickMenuItem mWnd, hSubMenu, 0 'Click on the first MenuItem of the Submenu
End Sub


Private Sub ScreenToAbsolute(lpPoint As POINTAPI)
    lpPoint.x = lpPoint.x * (&HFFFF& / GetSystemMetrics(SM_CXSCREEN))
    lpPoint.y = lpPoint.y * (&HFFFF& / GetSystemMetrics(SM_CYSCREEN))
End Sub

Private Sub Click(p As POINTAPI)
'p.X and p.Y in absolute coordinates
'Put the mouse on the point
    mouse_event MOUSEEVENTF_ABSOLUTE Or MOUSEEVENTF_MOVE, _
        p.x, p.y, 0, GetMessageExtraInfo()
'Mouse Down
    mouse_event MOUSEEVENTF_LEFTDOWN, _
        0, 0, 0, GetMessageExtraInfo()
'Mouse Up
    mouse_event MOUSEEVENTF_LEFTUP, _
        0, 0, 0, GetMessageExtraInfo()
End Sub

Private Sub ClickMenuItem(ByVal mWnd As Long, ByVal hMenu As Long, ByVal Pos As Long)
    Dim ret As Long
    Dim r As RECT, p As POINTAPI

    ret = GetMenuItemRect(mWnd, hMenu, Pos, r)

    If ret = 0 Then Exit Sub
   
    p.x = (r.Left + r.Right) / 2
    p.y = (r.Top + r.Bottom) / 2

    ScreenToAbsolute p
'Click on p
    Click p
End Sub


Espero te sea de utilidad. Nos vemos.
En línea


SELECT * FROM mejores_batos_ del_mundo WHERE id = (SELECT DISTINCT id_guapo FROM los_mas_guapos _del_mundo WHERE papito_chulo = 'ranefi')
Páginas: [1] Ir Arriba Imprimir 
« anterior próximo »
Ir a:  


Ingresar con nombre de usuario, contraseña y duración de la sesión

Powered by SMF 1.1.5 | SMF © 2006-2008, Simple Machines LLC hacker

Juegos gratis - Articulos PHP - Juegos - Trucos - Letras - Juegos - Juegos Online