Visual Basic - ¿COMO PUEDO HACER UN CLICK DEL RATON AUTOMÁTICO?

Life is soft - evento anual de software empresarial
 
Vista:

¿COMO PUEDO HACER UN CLICK DEL RATON AUTOMÁTICO?

Publicado por Fran (23 intervenciones) el 01/09/2000 00:00:00
Hola, Podría decirme alguien como puedo hacer para que mi programa efectue automaticamente un Click o un DobleClick sin que sea yo el que de al botón del Ratón??

Muchas Gracias.
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

RE:¿COMO PUEDO HACER UN CLICK DEL RATON AUTOMÁTICO

Publicado por Fernan (1 intervención) el 04/09/2000 00:00:00
Simplemente cuando quieras hacer click sobre un objeto debes escribir:
Objeto.mouse_click
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

ESO NO ES, ES UN CLICK AUTOMÁTICO...

Publicado por Fran (23 intervenciones) el 05/09/2000 00:00:00
Gracias por Responder Fernan, pero no es eso lo que quiero, lo que quiero es que haga un click del ratón automáticamente sea donde sea donde esté el raton, aun fuera del formulario...(no en ningun objeto en particular)...
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

RE:¿COMO PUEDO HACER UN CLICK DEL RATON AUTOMÁTICO

Publicado por Jesus Leon (3 intervenciones) el 08/09/2000 00:00:00
Te mando codigo para hacerlo usando la API de windows, este programa pulsa distintas partes de la pantalla.
Si no lo entiendes mandame un e-mail y te lo explico, si quieres que te mande todos los ficheros de VB dame tu e-mail.

Hasta luego.

<<<<-------- CUT CUT CUT ---------------->>>>>>>>>>>>>>

Private Type POINTAPI
x As Long
y As Long
End Type
Dim MousePoint As POINTAPI
Dim retval As Long ´ return value
Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
Private Declare Function SetCursorPos Lib "user32.dll" (ByVal x As Long, ByVal y As Long) As Long
Private 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)
Const MOUSEEVENTF_LEFTDOWN = &H2
Const MOUSEEVENTF_LEFTUP = &H4

Private Sub Timer1_Timer()
´Get the position of the cursor
GetCursorPos MousePoint
´Convert the point to our forms coordinates

´Show the position
box_X = MousePoint.x
BOX_Y = MousePoint.y
box_X = (Rnd * 800) + 100
BOX_Y = (Rnd * 500) + 70
Timer1.Interval = Rnd * 10000
mouse_event MOUSEEVENTF_LEFTDOWN, box_X, BOX_Y, 0, 0
mouse_event MOUSEEVENTF_LEFTUP, box_X, BOX_Y, 0, 0
retval = SetCursorPos(box_X, BOX_Y) ´ move the cursor to (100,200)
End Sub
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar