Results 1 to 3 of 3

Thread: Remote Mouse???

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 1999
    Posts
    2

    Post

    I'm trying to do a Remote Administration Tool I can move the mouse on the remote PC with SetMousePos API call, i need to do a click! how can i do that??

  2. #2
    Guru Aaron Young's Avatar
    Join Date
    Jun 1999
    Location
    Red Wing, MN, USA
    Posts
    2,177

    Post

    Use the Mouse_Event API, eg.
    Code:
    Private Type POINTAPI
            x As Long
            y As Long
    End Type
    
    Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
    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 DoMouseClick()
        Dim tCP As POINTAPI
        Call GetCursorPos(tCP)
        Call mouse_event(MOUSEEVENTF_LEFTDOWN Or MOUSEEVENTF_LEFTUP, tCP.x, tCP.y, 0&, 0)
    End Sub
    ------------------
    Aaron Young
    Analyst Programmer
    [email protected]
    [email protected]

  3. #3

    Thread Starter
    New Member
    Join Date
    Nov 1999
    Posts
    2

    Post

    Aaron thanx for your help your code looks easy, now is time to use it!! thanx a lot, this Remote Administration Tool will be improved with your help, thanx again.

    Regards
    Ismael

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width