mouse_envent

Alberto
28 de Julio del 2004
Hola, tengo un problema no puedo hacer correr bien la funcion(API):
mouse_event, que se detalla en:
http://www.mangovision.com/vbapi/ref/m/mouse_event.html

el ejemplo no funciona como deberia, simplemente no hace nada.
trabajo en VB6 bajo win98 pirmera 1ºed.

el ejemplo es:
' This code is licensed according to the terms and conditions listed here.

' Declarations and such needed for the example:
' (Copy them to the (declarations) section of a module.)
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)
Public Declare Function SetCursorPos Lib "user32.dll" (ByVal x As Long, ByVal y As Long) As Long

Private Sub Command1_Click()
Dim retval As Long ' return value

' Move the mouse cursor to the upper-left corner of the screen.
retval = SetCursorPos(0, 0)
' Click the left mouse button once.
mouse_event MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0
mouse_event MOUSEEVENTF_LEFTUP, 0, 0, 0, 0
End Sub

la funcion :SetCursorPos(0, 0) trabaja bien sin porblemas.