2.2.6.27.10 RichEdit::GetSelectionCharFormat

Description

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

Syntax

DWORD GetSelectionCharFormat( CHARFORMAT & cf )

Parameters

cf
Pointer to a CHARFORMAT structure to receive the character
formatting attributes of the current selection

Return

The dwMask data member of cf. It specifies the character formatting attributes

that are consistent throughout the current selection.

Remarks

Call this function to get the character formatting attributes

of the current selection. The cf parameter receives the

attributes of the first character in the current selection.

The return value specifies which attributes are consistent

throughout the selection.

Examples

EX1

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

void RichEdit_GetSelectionCharFormat(Dialog& EditBoxes)
{
	RichEdit richEdit = EditBoxes.GetItem(IDC_RICHEDIT1);
	CHARFORMAT cf; 
	cf.dwEffects = CFE_BOLD; 
	cf.dwMask = CFM_STRIKEOUT|CFM_BOLD;
	richEdit.SetSelectionCharFormat(cf);
	CHARFORMAT cfResult; 
	richEdit.GetSelectionCharFormat(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::SetSelectionCharFormat

Header to Include

Control.h