IchFromXpos (hwnd, ln, xp)

Returns the character index given a pixel x-position (xp) on the line number (ln) in the given window. The character index is the zero based index of a character on the specified line. The line does not actually have to be displayed in the window at the time this function is called. See also “XposFromIch (hwnd, ln, ich)”.






The window.


The line number that contains the text to be measured. If ln is out of range, then –1 is returned.


The x-position, which is relative to the left edge of the whole window. If xp exceeds the width of the line, then the total number of characters on the line is returned.

Note: You can use the XposFromIch function to perform the reverse mapping.