• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 368
  • Last Modified:

How to work with em_posfromchar?

I want to find out where the caret is in a richedit field.
Not the line or column numbers, but the position on the screen in pixels.

Please answer this question ...
0
hagur
Asked:
hagur
1 Solution
 
ronit051397Commented:
procedure TForm1.RichEdit1KeyUp(Sender: TObject; var Key: Word;
  Shift: TShiftState);
var
  P : TPoint;
  Point: Integer;
begin
  Point:=RichEdit1.Perform(EM_POSFROMCHAR,WParam(@P),RichEdit1.SelStart);
  caption:=inttostr(P.X)+','+inttostr(P.Y);
end;

0

Featured Post

[Webinar] Kill tickets & tabs using PowerShell

Are you tired of cycling through the same browser tabs everyday to close the same repetitive tickets? In this webinar JumpCloud will show how you can leverage RESTful APIs to build your own PowerShell modules to kill tickets & tabs using the PowerShell command Invoke-RestMethod.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now