Frank
Fri Apr 28 07:41:05 CDT 2006
28.04.2006 13:06, Y.C. Wu schrob:
> In a Edit Box, I could use "GetCaretPos()" to get the coordinate (x, y) of
> the cursor, but how can I get the Text at the position?
>
> In MFC, there is a funtion "CharFromPos()" to get the item, but there seems
> has no corresponding function in Win32 API?
Basically, strings are arrays of characters, in the case of PPC this would
mean TCHAR.
So first get the text of the edit box into a TCHAR array and then simply
access its characters by using an index.
Example:
TCHAR szText[100];
SendMessage(WM_GETTEXT,hwndEdit,(WPARAM)100,(LPARAM)szText);
// get the 5th character
TCHAR c=szText[4];
--
Gruß | Greetings | Qapla'
http://www.stud.tu-ilmenau.de/~frst-ii/