Results 1 to 4 of 4

Thread: Cursor Position - **RESOLVED**

Threaded View

  1. #1

    Thread Starter
    Addicted Member finn0013's Avatar
    Join Date
    Jan 2001
    Location
    Charleston, SC
    Posts
    222

    Angry Cursor Position - **RESOLVED**

    This is driving me nuts - I can not get X to equal NX or Y to equal NY. It all looks right to me, however I am just spinning my wheels now - just paste this in a form and run:

    VB Code:
    1. Option Explicit
    2.  
    3. Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
    4.  
    5. Private Type POINTAPI
    6.     x As Long
    7.     y As Long
    8. End Type
    9.  
    10. Private Sub Form_Load()
    11.     Me.Top = 0
    12.     Me.Left = 0
    13. End Sub
    14.  
    15. Private Sub Form_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
    16.  
    17.     Dim p As POINTAPI
    18.    
    19.     Call GetCursorPos(p)
    20.  
    21.     MsgBox "X: " & x & vbNewLine & _
    22.            "Y: " & y & vbNewLine & _
    23.            "PX: " & p.x & vbNewLine & _
    24.            "PY: " & p.y & vbNewLine & _
    25.            "NX: " & x / Screen.TwipsPerPixelX & vbNewLine & _
    26.            "NY: " & y / Screen.TwipsPerPixelY
    27. End Sub
    Last edited by finn0013; Nov 12th, 2003 at 01:56 PM.

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