could anyone suggest a way of making a character from point proc? sort of like the EM_CHARFROMPOS message. this has been the biggest problem i've had with my edit control, so far. i'm completely stumped.
is this a richedit or a normal edit control you're talking about?
neither, it's a custom one. i use a linked list to keep track of the lines. each one has a pointer to a string and a rect structure, as well as some other stuff. i can get the line number by using the PtInRect function, but i don't know how to get the character at that point.
you could use GetTextExtentExPoint - call it with the whole line and the X value you got from the point, and it'll give you the number of chars that fit inside that space (lpnFit). the char right after the last char that fits is the one in the point (i think :D)
Thanks, it works a little better than GetTextExtentPoint32. it's still coming out wrong sometimes though.
There is some C source on edit controls at www.codeproject.com. Their "Crystal" control can examine characters at or near the cursor.