Two comments.
1. You don't need to specify the dx and dy if the dwFlags doesn't include MOUSEEVENTF_ABSOLUTE. If you don't include it, the mouse_event procedure will move the cursor dx pixels to the right and dy pixels down. (0, 0) means don't move it at all.

2. You can click in one call, by combining MOUSEEVENTF_LEFTDOWN with MOUSEEVENTF_LEFTUP (&H2 Or &H4 = &H6).
Code:
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 Const MOUSEEVENTF_LEFTDOWN = &H2
Private Const MOUSEEVENTF_LEFTUP = &H4


Private Sub Command1_Click()
    Call mouse_event(MOUSEEVENTF_LEFTDOWN Or MOUSEEVENTF_LEFTUP, 0, 0, 0, 0)
End Sub
------------------
Yonatan
Teenage Programmer
E-Mail: [email protected]
ICQ: 19552879


[This message has been edited by Yonatan (edited 11-06-1999).]