GetSel
Gets the starting and ending positions of the current selection in this RichEdit control.
void GetSel( long & nStartChar, long & nEndChar )
void
EX1
#include <..\OriginLab\DialogEx.h> #define IDC_RICHEDIT1 1001 void RichEdit_GetSel(Dialog& EditBoxes) { RichEdit richEdit = EditBoxes.GetItem(IDC_RICHEDIT1); long nStartChar, nEndChar; richEdit.GetSel(nStartChar, nEndChar); string str; str.Format("Start:%d, End:%d\n", nStartChar, nEndChar); MessageBox(NULL, str, "Rich Edit Sample"); }
Call this function to retrieve the bounds of the current selection in this RichEdit control.
RichEdit::SetSel
Control.h