~~~~~~~~~~~~~~~~~~~~~~~~~
{
Usage:
var sRC:string;
src := GetPosition(RichEdit1) ;
//src reults in a string
//formated like: Row:Col
}
function GetPosition(ARichEdit: TRichEdit): string
var
iX,iY : Integer;
begin
iX := 0; iY := 0;
iY := SendMessage(ARichEdit.Handle,
EM_LINEFROMCHAR,
ARichEdit.SelStart,0) ;
iX := ARichEdit.SelStart -
SendMessage(ARichEdit.Handle,
EM_LINEINDEX, iY, 0) ;
Result := IntToStr(iY + 1) + ':' + IntToStr(iX + 1) ;
end;
~~~~~~~~~~~~~~~~~~~~~~~~~
Delphi tips navigator:
» Associate an application with a file extension
« Implementing a lasso drawing technique

