Results 1 to 4 of 4

Thread: Get the X and Y positions of the cursor

  1. #1

    Thread Starter
    Addicted Member Cuallito's Avatar
    Join Date
    Apr 2001
    Location
    You know that chest that you could never get opened? If you ever do, I'm there.
    Posts
    136

    Get the X and Y positions of the cursor

    How do I do this?
    BTW, Thanks for all your help

    Member of the anti-gay cross-dressing trans-species wolves alliance.

  2. #2
    Frenzied Member HarryW's Avatar
    Join Date
    Jan 2000
    Location
    Heiho no michi
    Posts
    1,827
    Use the GetCursorPos() API function. Or find a mouse event that does what you want and the coordinates will be handed to you in the event.
    Harry.

    "From one thing, know ten thousand things."

  3. #3
    Zaei
    Guest
    The D3D Device also gives you a CursorPos function, something like D3DDevice.GetCursorPos(...).

    Z.

  4. #4
    PowerPoster abdul's Avatar
    Join Date
    Dec 2000
    Location
    Ontario,Canada
    Posts
    2,827

    Red face that would work

    Add two labels, Name them "label1" and label2" Now add a timer control and set its interval to 1.

    Use the following code now:

    Code:
    Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
    Private Type POINTAPI
            x As Long
            y As Long
    End Type
    
    Dim pos As POINTAPI
    Private Sub Timer1_Timer()
    GetCursorPos pos
    Label1.Caption = "X:" & pos.x
    Label2.Caption = "Y:" & pos.y
    End Sub
    Have Fun!
    Baaaaaaaaah

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