Function TRXCUSTOMRICHEDIT.GETTEXTRANGE (StartPos, Endpos: longint): string;
VAR
TEXTRANGE: TTEXTRANGE;
Begin
// SETLENGTH (Result, Endpos - StartPOS 1);
SETLENGTH (Endpos - StartPOS) * 2 1);
TEXTRANGE.CHRG.CPMIN: = STARTPOS;
TextRange.chrg.cpmax: = endpos;
TextRange.lpstrText: = Pansichar (Result);
SetLength (Result, SendMessage (Handle, Em_GettextRange, 0, Longint (@TextRange));
END;
SELATTRIBUTES.LINK: =TRUE 2 Chinese characters will not have wrong, such as sure, cancel!