CRichEditCtrl::GetSel

void GetSel( CHARRANGE& cr ) const;

void GetSel( long& nStartChar, long& nEndChar ) const;

Parameters

cr

Reference to a CHARRANGE structure to receive the bounds of the current selection.

nStartChar

Zero-based index of the first character in the current selection.

nEndChar

Zero-based index of the last character in the current selection.

Remarks

Call this function to retrieve the bounds of the current selection in this CRichEditCtrl object.

The two forms of this function provide alternate ways to get the bounds for the selection. Brief descriptions of these forms follow:

The selection includes everything if the beginning (cpMin or nStartChar) is 0 and the end (cpMax or nEndChar) is  – 1.

For more information, see EM_EXGETSEL message and CHARRANGE structure in the Win32 documentation.

CRichEditCtrl OverviewClass MembersHierarchy Chart

See Also   CRichEditCtrl::SetSel, CRichEditCtrl::GetSelText, CRichEditCtrl::GetParaFormat, CRichEditCtrl::GetSelectionCharFormat