>> Hello, >> >> The EM_GETSEL message retrieves the selected text in an edit control, but it >> doesn't tell me where the caret is: it might be at the beginning or at the >> end of the selection. Does anybody know a way to retrieve that information? >> > >Yes Peter, the only places the caret could be is either SelStart or the >end of the selection that you would get by doing this: > > SelEnd := Edit1.SelStart + Edit1.SelLength;
That doesn't answer it, because what I want to know is whether the caret is at the beginning or the end of the text. But anyway, I found the answer in calling GetCaretPos to get the graphic position and then using EM_CHARFROMPOS to convert it to the character position. Peter Laman Senior Software Engineer Lance ICT Group Roermond, the Netherlands http://www.lance-safety.com __________________________________________________ Delphi-Talk mailing list -> [email protected] http://www.elists.org/mailman/listinfo/delphi-talk
