CRichEditView::GetCharFormatSelection

CHARFORMAT& GetCharFormatSelection( );

Return Value

A CHARFORMAT structure which contains the character formatting attributes of the current selection.

Remarks

Call this function to get the character formatting attributes of the current selection.

For more information, see the EM_GETCHARFORMAT message and the CHARFORMAT structure in the Win32 documentation.

Example

void CMyRichEditView::OnCharUnderline ()
{
    CHARFORMAT cf;
    cf = GetCharFormatSelection ();

    if (!(cf.dwMask & CFM_UNDERLINE) || !(cf.dwEffects & CFE_UNDERLINE))
        cf.dwEffects = CFE_UNDERLINE;
    else
        cf.dwEffects = 0;

    cf.dwMask = CFM_UNDERLINE;
    SetCharFormat (cf);
}

CRichEditView OverviewClass MembersHierarchy Chart

See Also   CRichEditView::SetCharFormat, CRichEditView::GetParaFormatSelection, CRichEditCtrl::GetSelectionCharFormat