Rich, Memo e Edit - posicao do cursor

Top  Previous  Next

procedure CaretPos(H: THandle; var Row, Column: Word);

begin

  Row    := SendMessage(H, EM_LINEFROMCHAR, -10);

  Column := LoWord(SendMessage(H,EM_GETSEL, 00)) - SendMessage(H, EM_LINEINDEX, -10);

end;

 

-------------------------------------------------------------------------------------------

 

RichEdit:

 

Linha :           RichText1.CaretPos.y;

Coluna:           RichText1.CaretPos.x;

Mover o cursor:   RichText1.SelStart:=Length(RichText1.Lines.Text);