Author: Jonas Bilinkevicius How can I determine the screen coordinates (x, y) of the highlighted text of a TRichEdit component? Answer: 1 2 procedure TForm1.Button3Click(Sender: TObject); 3 var 4 pt: TPoint; 5 begin 6 with richedit1 do 7 begin 8 pt := point(0, 0); 9 Perform(messages.EM_POSFROMCHAR, WPARAM(@pt), selstart); 10 {pt is in client coordinates} 11 label3.caption := Format('(%d, %d)', [pt.x, pt.y]); 12 {convert to screen coordinates} 13 pt := ClientToScreen(pt); 14 label2.caption := Format('(%d, %d)', [pt.x, pt.y]); 15 end; 16 end;