anchor.diff:    if stMatchCase in Options then Flags := Flags or FT_MATCHCASE;
   
     if RichEditVersion >= 4 then begin
  +      with FindW.chrg do begin
  +        cpMin := StartPos;
  +        cpMax := cpMin + Abs(LengthSearch);
  +      end;
         SearchStrUnicode := SysGetMem(1+Length(SearchStr)*2);
         StringToWideChar( SearchStr, PWideChar(SearchStrUnicode), Length(SearchStr)+1);
         FindW.lpstrText := PWideChar(SearchStrUnicode);
  
positive.code:       PChrg:= Longint(@FindW.chrgText);
    end
    else begin
        Find.lpstrText := PChar(SearchStr);
        Result := SendMessage(Handle, EM_FINDTEXTEX, Flags, Longint(@Find));
        PChrg:= Longint(@Find.chrgText);
  
negative.code:   Flags: Integer;
    SearchStrUnicode: PWideChar;   // dpv
  begin
    if RichEditVersion >= 2 then begin
      if not (stBackward in Options) then Flags := FT_DOWN
      else Flags := 0;
  