Results 1 to 4 of 4

Thread: Detecting where the mouse is and changing its position from time to time

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Sep 1999
    Location
    Leeds, UK
    Posts
    287

    Post

    Hi,

    Sure, I know how to detect where the mouse is when its over one of my forms, but how do I detect where it is when its just on the desktop or something? After detecting the position of the mouse, I would also like to move its position. Does anybody have any ideas?

    Thanks

  2. #2
    Addicted Member Razzle's Avatar
    Join Date
    Jan 2000
    Location
    Berlin, Germany
    Posts
    161

    Post

    you can use GetCursorPos to detect the position and SetCursorPos to change it.
    both are winapis.
    Public Declare Function GetCursorPos Lib "user32" Alias "GetCursorPos" (lpPoint As POINTAPI) As Long
    Public Declare Function SetCursorPos Lib "user32" Alias "SetCursorPos" (ByVal x As Long, ByVal y As Long) As Long
    Public Type POINTAPI
    x As Long
    y As Long
    End Type


    ------------------
    Razzle
    ICQ#: 31429438

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Sep 1999
    Location
    Leeds, UK
    Posts
    287

    Post

    Thanks again!

  4. #4
    Addicted Member Razzle's Avatar
    Join Date
    Jan 2000
    Location
    Berlin, Germany
    Posts
    161

    Post

    no problem

    ------------------
    Razzle
    ICQ#: 31429438

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