anchor.diff:  type
     PENLink = ^TENLink;
     PENOleOpFailed = ^TENOleOpFailed;
  -{$IFDEF RICHEDIT_VER_41}               // dpv
  -  TFindTextEx = TFindTextExW;          // Unicode..
  -{$ELSE}
     TFindTextEx = TFindTextExA;
  -{$ENDIF}
   
   
     TTextRangeA = record
  
positive.code:               (dwMajorVersion >= 5) then
                RichEditVersion := 3;
            end;
        end;
      end;
    finally
      SetErrorMode(OldError);
  
negative.code:   if stWholeWord in Options then Flags := Flags or FT_WHOLEWORD;
    if stMatchCase in Options then Flags := Flags or FT_MATCHCASE;
  
    if RichEditVersion >= 4 then begin
        SearchStrUnicode := SysGetMem(1+Length(SearchStr)*2);
        StringToWideChar( SearchStr, PWideChar(SearchStrUnicode), Length(SearchStr)+1);
        FindW.lpstrText := PWideChar(SearchStrUnicode);
        Result := SendMessage(Handle, EM_FINDTEXTEXW, Flags, Longint(@FindW));
        SysFreeMem(SearchStrUnicode);
        PChrg:= Longint(@FindW.chrgText);
    end
    else begin
        Find.lpstrText := PChar(SearchStr);
        Result := SendMessage(Handle, EM_FINDTEXTEX, Flags, Longint(@Find));
        PChrg:= Longint(@Find.chrgText);
    end;
  
    if (Result >= 0) and (stSetSelection in Options) then begin
       SendMessage(Handle, EM_EXSETSEL, 0, PChrg);
       SendMessage(Handle, EM_SCROLLCARET, 0, 0);
    end;
  end;
  
  procedure TRxCustomRichEdit.ClearUndo;
  begin
  