vb Code:
  1. Private Declare Sub GetCursorPos Lib "User32" (lpPoint As POINTAPI)
  2.  
  3. Private Type POINTAPI
  4.      x As Long
  5.      y As Long
  6. End Type
  7.  
  8. Private Sub Form_Load()
  9.       Timer1.Enabled = True
  10.       Timer1.Interval = 50
  11. End Sub
  12.  
  13. Private Sub Timer1_Timer()
  14.     Dim Rect As POINTAPI
  15.     GetCursorPos Rect
  16.     Label1.Caption = "X = " & Rect.x
  17.     Label2.Caption = "Y = " & Rect.y
  18. End Sub

Use this with a timer to get it.