MSDN Home >  MSDN Library >  User Interface Design and Development >  Windows Shell >  Windows Controls >  Individual Control Information >  Rich Edit Controls > 

EM_GETCHARFORMAT Message


The EM_GETCHARFORMAT message determines the current character formatting in a rich edit control.

Syntax

To send this message, call the SendMessage function as follows.
lResult = SendMessage(     // returns LRESULT in lResult
   (HWND) hWndControl,     // handle to destination control
   (UINT) EM_GETCHARFORMAT,     // message ID
   (WPARAM) wParam,     // = (WPARAM) () wParam;
   (LPARAM) lParam     // = (LPARAM) () lParam;
);

Parameters

wParam
Specifies the character formatting that applies to the control. It can be one of the following values.
SCF_DEFAULT
Gets the default character formatting.
SCF_SELECTION
Gets the current selection's character formatting.
lParam
Pointer to a CHARFORMAT structure. If the selection formatting is being retrieved, the structure receives the attributes of the first character and the dwMask member specifies which attributes are consistent throughout the entire 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.h
Minimum operating systems Windows 95, Windows NT 4.0

See Also

Rich Edit Controls, CHARFORMAT, CHARFORMAT2
 Contact Us   |  E-Mail this Page   |  MSDN Flash Newsletter
 © 2003 Microsoft Corporation. All rights reserved.   Terms of Use  Privacy Statement   Accessibility