The EM_GETCHARFORMAT message determines the character formatting in a rich edit control.
Syntax
To send this message, call the SendMessage function as follows. lResult = SendMessage( // returns LRESULT in lResult hWndControl, // (HWND) handle to destination control EM_GETCHARFORMAT, // (UINT) message ID wParam, // = () wParam; lParam // = () lParam; );
lResult = SendMessage( // returns LRESULT in lResult hWndControl, // (HWND) handle to destination control EM_GETCHARFORMAT, // (UINT) message ID wParam, // = () wParam; lParam // = () lParam; );
Parameters
wParam Specifies the range of text from which to retrieve formatting. It can be one of the following values. SCF_DEFAULTThe default character formatting.SCF_SELECTIONThe current selection's character formatting.lParam Pointer to a CHARFORMAT structure that receives the attributes of the first character. The dwMask member specifies which attributes are consistent throughout the entire selection. For example, if the entire selection is either in italics or not in italics, CFM_ITALIC is set; if the selection is partly in italics and partly not, CFM_ITALIC is not set. Microsoft Rich Edit 2.0 and later: This parameter can be a pointer to a CHARFORMAT2 structure, which is an extension of the CHARFORMAT structure. Before sending the EM_GETCHARFORMAT message, set the structure's cbSize member to indicate the version of the structure.
SCF_DEFAULT
SCF_SELECTION
Microsoft Rich Edit 2.0 and later: This parameter can be a pointer to a CHARFORMAT2 structure, which is an extension of the CHARFORMAT structure. Before sending the EM_GETCHARFORMAT message, set the structure's cbSize member to indicate the version of the structure.
Return Value
This message returns the value of the dwMask member of the CHARFORMAT structure.
Message Information
HeaderDeclared in Richedit.hMinimum operating systems Windows 95, Windows NT 4.0
See Also
CHARFORMAT, CHARFORMAT2