VB Code:
Option Explicit
Private Type POINTAPI
x As Long
y As Long
End Type
Private Declare Function GetCaretPos Lib "user32" (lpPoint As POINTAPI) As Long
Private Declare Function ClientToScreen Lib "user32" (ByVal hwnd As Long, lpPoint As POINTAPI) As Long
Private Sub Form_Load()
Timer1.Interval = 100
Timer1.Enabled = True
End Sub
Private Sub Form_Unload(Cancel As Integer)
Timer1.Enabled = False
End Sub
Private Sub Timer1_Timer()
Dim tPOINT As POINTAPI
Call GetCaretPos(tPOINT)
Call ClientToScreen(Text1.hwnd, tPOINT)
Caption = "X: " & tPOINT.x & " - Y:" & tPOINT.y
End Sub