Monday, December 1, 2008

Select Full Text without changing the Caret pos in CRichEditCtrl

CPoint pt = GetCaretPos();

int x = CharFromPos(pt);

SetSel(0, -1);

SendMessage(WM_HSCROLL, MAKEWPARAM(SB_THUMBPOSITION, x), 0);

No comments: