# 您要的是EM_POSFROMCHAR

Posted by cww on March 03, 1999 at 13:24:22:

In Reply to: 有关于RichTextBox的问题: posted by Cool_G on March 03, 1999 at 11:51:05:

使用 SendMessage，以下节录win32.hlp
EM_POSFROMCHAR
wParam = (WPARAM)wCharIndex; // zero-based index of character
lParam = 0; // not used, must be zero
An application sends the EM_POSFROMCHAR message to retrieve the coordinates of the specified character in an edit control.

Parameters

wCharIndex
Value of wParam. Specifies the zero-based index of
the character.

Return Value
The return value specifies the coordinates of the
upper-left corner of the character. If wCharIndex
is greater than the index of the last character
in the control, the return value specifies the
coordinates of the position just past the last
character in the control. The x-coordinate is in
the low-order word and the y-coordinate is in
the high-order word. The coordinates are relative
to the upper-left corner of the edit control's
client area.

Follow Ups: