THtmlViewer component
function XYToDisplayPos(X, Y: integer): integer;
Given X, Y coordinates on the display, XYToDisplayPos finds the display character position for that location. Dimensions are in pixels relative to the upper left corner of the display. The character position returned is the same as would be returned by the SelStart property if the mouse were clicked at that location.
XYToDisplayPos returns -1 for X, Y locations where there is no text.