Results 1 to 2 of 2

Thread: How can you move the mouse to a certain point on the screen?

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    May 2002
    Posts
    628

    How can you move the mouse to a certain point on the screen?

    anyone know?

  2. #2
    Hyperactive Member MikeBAM's Avatar
    Join Date
    Sep 2000
    Location
    Metro Detroit
    Posts
    284
    That's an easy one.

    VB Code:
    1. Declare Function SetCursorPos Lib "user32" (ByVal x As Long, ByVal y As Long) As Long
    2.  
    3.  
    4. Dim X as Integer, Y as Integer
    5. X = 0
    6. Y = 0
    7. Call SetCursorPos(X, Y)

    if you loop that u can have it stick in the corrner.
    Another fun thing to do is put in random numbers for X and Y.

    or if you want to get the mouse pos then do this:
    VB Code:
    1. Public Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
    2.  
    3. Type POINTAPI
    4.    x As Long
    5.    y As Long
    6. End Type
    7.  
    8. Dim XX as Integer
    9. Dim YY as Integer
    10. Dim CurPos As POINTAPI
    11.  
    12. Call GetCursorPos(CurPos)
    13. XX = CurPos.x
    14. YY = CurPos.y
    ~* )v( ! /< E *~

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