Help Center

CRichEdit.FindTextExmethod

Finds text within a rich edit control.

Windowsmethoddocumented

Syntax

FUNCTION FindTextEx (BYVAL hRichEdit AS HWND, BYVAL fOptions AS DWORD, BYVAL lpftexw AS FINDTEXTEXW PTR) AS LONG

Parameters

NameDescription
hRichEditThe handle of the rich edit control.
fOptionsSpecifies the parameters of the search operation. This parameter can be one or more of the following values.
FR_DOWN. If set, the operation searches from the end of the current selection to the end of the document. If not set, the operation searches from the end of the current selection to the beginning of the document.
FR_MATCHALEFHAMZA. By default, Arabic and Hebrew alefs with different accents are all matched by the alef character. Set this flag if you want the search to differentiate between alefs with different accents.
FR_MATCHCASE. If set, the search operation is case-sensitive. If not set, the search operation is case-insensitive.
FR_MATCHDIAC. By default, Arabic and Hebrew diacritical marks are ignored. Set this flag if you want the search operation to consider diacritical marks.
FR_MATCHKASHIDA. By default, Arabic and Hebrew kashidas are ignored. Set this flag if you want the search operation to consider kashidas.
FR_WHOLEWORD. If set, the operation searches only for whole words that match the search string. If not set, the operation also searches for word fragments that match the search string.
lpftexwA pointer to a FINDTEXTEXW structure containing information about the find operation.

Return value

If the target string is found, the return value is the zero-based position of the first character of the match. If the target is not found, the return value is -1.

Description

Finds Unicode text within a rich edit control.

Remarks

FindTextEx uses the FINDTEXTEXW structure, while FindText uses the FINDTEXTW structure. The difference is that EM_FINDTEXTEXW reports the range of text that was found.

Reference

  • Defined in AfxNova/CRichEdit.inc:332
  • Documented in Windows/WIndows Controls/CRichEdit Class.md
  • Topic: CRichEdit Class