tutorial 34: richedit control: more text operations
you'll learn more about text operations under richedit control. specifically, you'll know how to search for/replace text, jumping to specific line number.
download the example.
theory
searching for text
there are several text operations under richedit control. searching for text is one such operation. searching for text is done by sending em_findtext or em_findtextex. these messages has a small difference.
em_findtext wparam == search options. can be any combination of the values in the table below.these options are identical for both em_findtext and em_findtextex
fr_down if this flag is specified, the search starts from the end of the current selection to the end of the text in the control (downward). this flag has effect only for richedit 2.0 or later: this behavior is the default for richedit 1.0. the default behavior of richedit 2.0 or later is to search from the end of the current selection to the beginning of the text (upward).
in summary, if you use richedit 1.0, you can't do anything about the search direction: it always searches downward. if you use richedit 2.0 and you want to search downward, you must specify this flag else the search would be upward.fr_matchcase if this flag is specified, the search is case-sensitive. fr_wholeword if this flag is set, the search finds the whole word that matches the specified search string.