啊 嗯嗯 好涨 bl:CRichEditCtrl::FindText怎么使用?

来源:百度文库 编辑:高校问答 时间:2024/05/09 01:31:44
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);