RichEdit::GetDefaultCharFormat

Description

Retrieves the current default character formatting attributes in this RichEdit control.

Syntax

DWORD GetDefaultCharFormat( CHARFORMAT & cf )

Parameters

cf
Pointer to a CHARFORMAT structure which will hold the
default character formatting attributes.

Return

The dwMask data member of cf. It specified the default

character formatting attributes.

Examples

EX1

#include <..\OriginLab\DialogEx.h>
#define IDC_RICHEDIT1 1001

void RichEdit_GetDefaultCharFormat(Dialog& EditBoxes)
{
        RichEdit richEdit = EditBoxes.GetItem(IDC_RICHEDIT1);
        CHARFORMAT cf; 
        cf.dwEffects = CFE_BOLD; 
        cf.dwMask = CFM_STRIKEOUT|CFM_BOLD;
        richEdit.SetDefaultCharFormat(cf);
        CHARFORMAT cfResult; 
        richEdit.GetDefaultCharFormat(cfResult);
        ASSERT((cfResult.dwMask&(CFM_STRIKEOUT|CFM_BOLD)) == (CFM_STRIKEOUT|CFM_BOLD));
        ASSERT((cfResult.dwEffects & (CFE_STRIKEOUT|CFE_BOLD) ) == CFE_BOLD);
}

Remark

See Also

RichEdit::SetDefaultCharFormat

header to Include

Control.h