// [6/8/2010 yangfeng] 用消息实现全选
//CHARRANGE cr;
//cr.cpMin = 0;
//cr.cpMax = -1;
//::SendMessage(m_RichEdit.m_hWnd, EM_EXSETSEL, 0, (LPARAM)&cr);
// [6/8/2010 yangfeng] 用消息实现全选
// [6/8/2010 yangfeng] 用消息实现查找
FINDTEXTEX Front,Behind;
Front.chrg.cpMin = 0;
Front.chrg.cpMax = -1;
Front.lpstrText = _T("<");
Behind.chrg.cpMin = 0;
Behind.chrg.cpMax = -1;
Behind.lpstrText = _T(">");
::SendMessage(m_RichEdit.m_hWnd, EM_FINDTEXTEX,FR_DOWN,(LPARAM)&Front);
::SendMessage(m_RichEdit.m_hWnd, EM_FINDTEXTEX,FR_DOWN,(LPARAM)&Behind);
CHARRANGE cr = {0};
cr.cpMin = Front.chrgText.cpMin;
cr.cpMax = Behind.chrgText.cpMax;
::SendMessage(m_RichEdit.m_hWnd, EM_EXSETSEL, 0, (LPARAM)&cr);
m_RichEdit.SetFocus();
阅读(1219) | 评论(0) | 转发(0) |