CRichEditCtrl::FindText怎么使用?
发布网友
发布时间:2022-04-23 15:00
我来回答
共1个回答
热心网友
时间:2023-10-05 05:16
试试这个
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);