英航额外行李:CRichEditCtrl::FindText怎么使用?

来源:百度文库 编辑:杭州交通信息网 时间:2024/05/11 01:12:52
VC编程

试试这个
extern CRichEditCtrl* pmyRichEditCtrl;

extern LPCTSTR lpszmyString;

// Set the selection to be the first occurrence of the
// string lpszmyString, if it is found.
FINDTEXTEX ft;
ft.chrg.cpMin = 0;
ft.chrg.cpMax = -1;
ft.lpstrText = (LPSTR) lpszmyString;
long n = pmyRichEditCtrl->FindText(FR_MATCHCASE|FR_WHOLEWORD, &ft);
if (n != -1)
pmyRichEditCtrl->SetSel(ft.chrgText);