The GetCaretPos function returns the caret's position in client coordinates. It is a simple wrapper around Win32 GetCaretPos
( $cx, cy ) = GetCaretPos( $hwnd );
Handle of a window in which the caret is placed
x coordinate of a caret
y coordinate of a caret