Results 1 to 2 of 2

Thread: Mouse

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Feb 2000
    Posts
    135

    Unhappy

    Hi there,
    I am really stuck and i need help! I need to be able to move the mouse cursor using code or something... Please help!!!! I need to be able to move the cursor say from one side of the screen to the other...

    Is this possible? Please help!

  2. #2
    Frenzied Member
    Join Date
    Mar 2000
    Posts
    1,089
    you need to use the Get/Setcursorpos API, here's the declarations you need.

    Code:
    Private Type POINTAPI
            x As Long
            y As Long
    End Type
    Private Declare Function GetCursorPos Lib "user32" Alias "GetCursorPos" (lpPoint As POINTAPI) As Long
    Private Declare Function SetCursorPos Lib "user32" Alias "SetCursorPos" (ByVal x As Long, ByVal y As Long) As Long
    get cursor pos fills a variable of type pointAPI with the current mouse coords, SetCursorPos moves the mouse to a point on the screen

    The Coords are inpixels from the top left of the screen.

    Hope this helps


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