Export (0) Print
Expand All

Rich Edit

This section contains information about the programming elements used with rich edit controls. A rich edit control enables the user to enter, edit, print, and save text. The text can be assigned character and paragraph formatting, and can include embedded Component Object Model (COM) objects.

Because rich edit controls support almost all of the messages and notification codes used with multiline Edit Controls, applications that already use edit controls can easily be changed to use rich edit controls.

Overviews

TopicContents
About Rich Edit Controls

This section introduces rich edit controls.

Using Rich Edit Controls

This section contains topics that demonstrate how to create and use rich edit controls.

 

Functions

TopicContents
AutoCorrectProc

The AutoCorrectProc function is an application defined callback function used with the EM_SETAUTOCORRECTPROC message.

EditStreamCallback

The EditStreamCallback function is an application defined callback function used with the EM_STREAMIN and EM_STREAMOUT messages. It is used to transfer a stream of data into or out of a rich edit control.

EditWordBreakProcEx

The EditWordBreakProcEx function is an application defined callback function used with the EM_SETWORDBREAKPROCEX message. It determines the character index of the word break or the character class and word-break flags of the characters in the specified text.

HyphenateProc

The HyphenateProc function is an application defined callback function used with the EM_SETHYPHENATEINFO message. It determines how hyphenation is done in a Microsoft Rich Edit control.

 

Interfaces

TopicContents
IRichEditOle

The IRichEditOle interface exposes the COM functionality of a rich edit control. The interface can be obtained by sending the EM_GETOLEINTERFACE message.

IRichEditOleCallback

The IRichEditOleCallback interface is used by a rich text edit control to retrieve OLE-related information from its client. A rich edit control client is responsible for implementing this interface and assigning it to the control by using the EM_SETOLECALLBACK message.

 

Messages

TopicContents
EM_AUTOURLDETECT

Enables or disables automatic detection of URLs by a rich edit control.

EM_CANPASTE

Determines whether a rich edit control can paste a specified clipboard format.

EM_CANREDO

Determines whether there are any actions in the control redo queue.

EM_DISPLAYBAND

Displays a portion of the contents of a rich edit control, as previously formatted for a device using the EM_FORMATRANGE message.

EM_EXGETSEL

Retrieves the starting and ending character positions of the selection in a rich edit control.

EM_EXLIMITTEXT

Sets an upper limit to the amount of text the user can type or paste into a rich edit control.

EM_EXLINEFROMCHAR

Determines which line contains the specified character in a rich edit control.

EM_EXSETSEL

Selects a range of characters or COM objects in a Rich Edit control.

EM_FINDTEXT

Finds text within a rich edit control.

EM_FINDTEXTEX

Finds text within a rich edit control.

EM_FINDTEXTEXW

Finds Unicode text within a rich edit control.

EM_FINDTEXTW

Finds Unicode text within a rich edit control.

EM_FINDWORDBREAK

Finds the next word break before or after the specified character position or retrieves information about the character at that position.

EM_FORMATRANGE

Formats a range of text in a rich edit control for a specific device.

EM_GETAUTOURLDETECT

Indicates whether the auto URL detection is turned on in the rich edit control.

EM_GETBIDIOPTIONS

Indicates the current state of the bidirectional options in the rich edit control.

EM_GETCHARFORMAT

Determines the character formatting in a rich edit control.

EM_GETCTFMODEBIAS

Gets the Text Services Framework (TSF) mode bias values for a Rich Edit control.

EM_GETCTFOPENSTATUS

Determines if the TSF keyboard is open or closed.

EM_GETEDITSTYLE

Retrieves the current edit style flags.

EM_GETEVENTMASK

Retrieves the event mask for a rich edit control. The event mask specifies which notification codes the control sends to its parent window.

EM_GETHYPHENATEINFO

Gets information about hyphenation for a Rich Edit control.

EM_GETIMECOLOR

Retrieves the Input Method Editor (IME) composition color. This message is available only in Asian-language versions of the operating system.

EM_GETIMECOMPMODE

Gets the current IME mode for a rich edit control.

EM_GETIMECOMPTEXT

Gets the IME composition text.

EM_GETIMEMODEBIAS

Gets the IME mode bias for a Rich Edit control.

EM_GETIMEOPTIONS

Retrieves the current IME options. This message is available only in Asian-language versions of the operating system.

EM_GETIMEPROPERTY

Gets the property and capabilities of the IME associated with the current input locale.

EM_GETLANGOPTIONS

Gets a rich edit control's option settings for IME and Asian language support.

EM_GETOLEINTERFACE

Retrieves an IRichEditOle object that a client can use to access a rich edit control's COM functionality.

EM_GETOPTIONS

Retrieves rich edit control options.

EM_GETPAGEROTATE

Deprecated. Gets the text layout for a Rich Edit control.

EM_GETPARAFORMAT

Retrieves the paragraph formatting of the current selection in a rich edit control.

EM_GETPUNCTUATION

Gets the current punctuation characters for the rich edit control. This message is available only in Asian-language versions of the operating system.

EM_GETREDONAME

Retrieves the type of the next action, if any, in the rich edit control's redo queue.

EM_GETSCROLLPOS

Obtains the current scroll position of the edit control.

EM_GETSELTEXT

Retrieves the currently selected text in a rich edit control.

EM_GETTEXTEX

Gets all of the text from the rich edit control in any particular code base you want.

EM_GETTEXTLENGTHEX

Calculates text length in various ways. It is usually called before creating a buffer to receive the text from the control.

EM_GETTEXTMODE

Gets the current text mode and undo level of a rich edit control.

EM_GETTEXTRANGE

Retrieves a specified range of characters from a rich edit control.

EM_GETTYPOGRAPHYOPTIONS

Retrieves the current state of the typography options of a rich edit control.

EM_GETUNDONAME

Microsoft Rich Edit 2.0 and later: Retrieves the type of the next undo action, if any.

Microsoft Rich Edit 1.0: This message is not supported.

EM_GETWORDBREAKPROCEX

Retrieves the address of the currently registered extended word-break procedure.

EM_GETWORDWRAPMODE

Gets the current word wrap and word-break options for the rich edit control. This message is available only in Asian-language versions of the operating system.

EM_GETZOOM

Gets the current zoom ratio, which is always between 1/64 and 64.

EM_HIDESELECTION

Hides or shows the selection in a rich edit control.

EM_ISIME

Determines whether the current input locale is an East Asian locale.

EM_PASTESPECIAL

Pastes a specific clipboard format in a rich edit control.

EM_RECONVERSION

Invokes the IME reconversion dialog box.

EM_REDO

Redoes the next action in the control's redo queue.

EM_REQUESTRESIZE

Forces a rich edit control to send an EN_REQUESTRESIZE notification code to its parent window.

EM_SELECTIONTYPE

Determines the selection type for a rich edit control.

EM_SETBIDIOPTIONS

Sets the current state of the bidirectional options in the rich edit control.

EM_SETBKGNDCOLOR

Sets the background color for a rich edit control.

EM_SETCHARFORMAT

Sets character formatting in a rich edit control.

EM_SETCTFMODEBIAS

Set the TSF mode bias for a Rich Edit control.

EM_SETCTFOPENSTATUS

Opens or closes the TSF keyboard.

EM_SETEDITSTYLE

Sets the current edit style flags.

EM_SETEVENTMASK

Sets the event mask for a rich edit control. The event mask specifies which notification codes the control sends to its parent window.

EM_SETFONTSIZE

Sets the font size for the selected text.

EM_SETHYPHENATEINFO

Sets the way a Rich Edit control does hyphenation.

EM_SETIMECOLOR

Sets the IME composition color. This message is available only in Asian-language versions of the operating system.

EM_SETIMEMODEBIAS

Sets the IME mode bias for a Rich Edit control.

EM_SETIMEOPTIONS

Sets the IME options. This message is available only in Asian-language versions of the operating system.

EM_SETLANGOPTIONS

Sets options for IME and Asian language support in a rich edit control.

EM_SETOLECALLBACK

Gives a rich edit control an IRichEditOleCallback object that the control uses to get OLE-related resources and information from the client.

EM_SETOPTIONS

Sets the options for a rich edit control.

EM_SETPAGEROTATE

Deprecated. Sets the text layout for a Rich Edit control.

EM_SETPALETTE

Changes the palette that rich edit uses for its display window.

EM_SETPARAFORMAT

Sets the paragraph formatting for the current selection in a rich edit control.

EM_SETPUNCTUATION

Sets the punctuation characters for a rich edit control. This message is available only in Asian-language versions of the operating system.

EM_SETSCROLLPOS

Tells the rich edit control to scroll to a particular point.

EM_SETTARGETDEVICE

Sets the target device and line width used for "what you see is what you get" (WYSIWYG) formatting in a rich edit control.

EM_SETTEXTEX

Combines the functionality of WM_SETTEXT and EM_REPLACESEL, and adds the ability to set text using a code page and to use either rich text or plain text.

EM_SETTEXTMODE

Sets the text mode or undo level of a rich edit control. The message fails if the control contains any text.

EM_SETTYPOGRAPHYOPTIONS

Sets the current state of the typography options of a rich edit control.

EM_SETUNDOLIMIT

Sets the maximum number of actions that can stored in the undo queue.

EM_SETWORDBREAKPROCEX

Sets the extended word-break procedure.

EM_SETWORDWRAPMODE

Sets the word-wrapping and word-breaking options for the rich edit control. This message is available only in Asian-language versions of the operating system.

EM_SETZOOM

Sets the zoom ratio anywhere between 1/64 and 64.

EM_SHOWSCROLLBAR

Shows or hides one of the scroll bars in the Text Host window.

EM_STOPGROUPTYPING

Stops the control from collecting additional typing actions into the current undo action. The control stores the next typing action, if any, into a new action in the undo queue.

EM_STREAMIN

Replaces the contents of a rich edit control with a stream of data provided by an application defined–EditStreamCallback callback function.

EM_STREAMOUT

Causes a rich edit control to pass its contents to an application–defined EditStreamCallback callback function. The callback function can then write the stream of data to a file or any other location that it chooses.

 

Notifications

TopicContents
EN_ALIGNLTR

Notifies a rich edit control's parent window that the paragraph direction has changed to left-to-right. A rich edit control sends this notification code in the form of a WM_COMMAND message.

EN_ALIGNRTL

Notifies a rich edit control's parent window that the paragraph direction changed to right-to-left. A rich edit control sends this notification code in the form of a WM_COMMAND message.

EN_CORRECTTEXT

Notifies a rich edit control's parent window that a SYV_CORRECT gesture occurred, giving the parent window a chance to cancel correcting the text. A rich edit control sends this notification code in the form of a WM_NOTIFY message.

EN_DRAGDROPDONE

Notifies a rich edit control's parent window that the drag-and-drop operation has completed. A rich edit control sends this notification code in the form of a WM_NOTIFY message.

EN_DROPFILES

Notifies a rich edit control's parent window that the user is attempting to drop files into the control. A rich edit control sends this notification code in the form of a WM_NOTIFY message when it receives the WM_DROPFILES message.

EN_IMECHANGE

Notifies a rich edit control's parent that the IME conversion status has changed. This message is available only for Asian-language versions of the operating system. A rich edit control sends this notification code in the form of a WM_COMMAND message.

EN_LINK

Notifies a rich edit control's parent window when the user clicks the mouse or when the mouse pointer is over text that has the CFE_LINK effect. The parent window of the control receives this notification code through a WM_NOTIFY message.

EN_LOWFIRTF

Notifies a rich edit control's parent window of a Rich Edit control that an unsupported Rich Text Format (RTF) keyword was received. A Rich Edit control sends this notification code in the form of a WM_NOTIFY message.

EN_MSGFILTER

Notifies a rich edit control's parent window of a keyboard or mouse event in the control. A rich edit control sends this notification code in the form of a WM_NOTIFY message.

EN_OBJECTPOSITIONS

Notifies a rich edit control's parent window when the control reads in objects. A rich edit control sends this notification code in the form of a WM_NOTIFY message.

EN_OLEOPFAILED

Notifies a rich edit control's parent window that a user action on a COM object has failed. A rich edit control sends this notification code in the form of a WM_NOTIFY message.

EN_PROTECTED

Notifies a rich edit control's parent window that the user is taking an action that would change a protected range of text. A rich edit control sends this notification code in the form of a WM_NOTIFY message.

EN_REQUESTRESIZE

Notifies a rich edit control's parent window that the control's contents are either smaller or larger than the control's window size. A rich edit control sends this notification code in the form of a WM_NOTIFY message.

EN_SAVECLIPBOARD

Notifies the rich edit control's parent window that the control is closing and the clipboard contains information. A rich edit control sends this notification code in the form of a WM_NOTIFY message.

EN_SELCHANGE

Notifies a rich edit control's parent window that the current selection has changed. A rich edit control sends this notification code in the form of a WM_NOTIFY message.

EN_STOPNOUNDO

Notifies a rich edit control's parent window that an action occurred for which the control cannot allocate enough memory to maintain the undo state. A rich edit control sends this notification code in the form of a WM_NOTIFY message.

 

Structures

TopicContents
BIDIOPTIONS

Contains bidirectional information about a rich edit control. This structure is used by the EM_GETBIDIOPTIONS and EM_SETBIDIOPTIONS messages to get and set the bidirectional information for a control.

CHARFORMAT

Contains information about character formatting in a rich edit control.

CHARFORMAT2

Contains information about character formatting in a rich edit control. CHARFORMAT2 is a Microsoft Rich Edit 2.0 extension of the CHARFORMAT structure. Microsoft Rich Edit 2.0 allows you to use either structure with the EM_GETCHARFORMAT and EM_SETCHARFORMAT messages.

CHARRANGE

Specifies a range of characters in a rich edit control.

COMPCOLOR

Contains color settings for a composition string.

EDITSTREAM

Contains information that an application passes to a rich edit control in a EM_STREAMIN or EM_STREAMOUT message. The rich edit control uses the information to transfer a stream of data into or out of the control.

ENCORRECTTEXT

Contains information about the selected text to be corrected.

ENDROPFILES

Contains information associated with an EN_DROPFILES notification code. A rich edit control sends this notification code when it receives a WM_DROPFILES message.

ENLINK

Contains information about an EN_LINK notification code from a rich edit control.

ENLOWFIRTF

Contains information about an unsupported RTF keyword in a Rich Edit control.

ENOLEOPFAILED

Contains information about a failed operation.

ENPROTECTED

Contains information associated with an EN_PROTECTED notification code. A rich edit control sends this notification when the user attempts to edit protected text.

ENSAVECLIPBOARD

Contains information about objects and text on the clipboard.

FINDTEXT

Contains information about a search operation in a rich edit control. This structure is used with the EM_FINDTEXT message.

FINDTEXTEX

Contains information about text to search for in a rich edit control. This structure is used with the EM_FINDTEXTEX message.

FORMATRANGE

Contains information that a rich edit control uses to format its output for a particular device. This structure is used with the EM_FORMATRANGE message.

GETTEXTEX

Contains information about an operation to get text from a rich edit control. This structure is passed in the wParam in the EM_GETTEXTEX message.

GETTEXTLENGTHEX

Contains information about how the text length of a rich edit control should be calculated. This structure is passed in the wParam in the EM_GETTEXTLENGTHEX message.

HYPHENATEINFO

Contains information about hyphenation in a Rich Edit control.

HYPHRESULT

Contains information about the result of hyphenation in a Rich Edit control.

IMECOMPTEXT

Contains information about the composition text in a Rich Edit control.

MSGFILTER

Contains information about a keyboard or mouse event. A rich edit control sends this structure to its parent window as part of an EN_MSGFILTER notification code, enabling the parent to change the message or prevent it from being processed.

OBJECTPOSITIONS

Contains object position information.

PARAFORMAT

Contains information about paragraph formatting attributes in a rich edit control. This structure is used with the EM_GETPARAFORMAT and EM_SETPARAFORMAT messages.

PARAFORMAT2

Contains information about paragraph formatting attributes in a rich edit control.

PUNCTUATION

Contains information about the punctuation used in a rich edit control.

REOBJECT

Contains information about an object.

REPASTESPECIAL

Contains information identifying whether the display aspect of a pasted object should be based on the content of the object or the icon that represent the object.

REQRESIZE

Contains the requested size of a rich edit control. A rich edit control sends this structure to its parent window as part of an EN_REQUESTRESIZE notification code.

SELCHANGE

Contains information associated with an EN_SELCHANGE notification code. A rich edit control sends this notification to its parent window when the current selection changes.

SETTEXTEX

Specifies which code page (if any) to use in setting text, whether the text replaces all the text in the control or just the selection, and whether the undo state is to be preserved.

TEXTRANGE

Receives a range of text from a rich edit control. This structure is filled in by the EM_GETTEXTRANGE message. The buffer pointed to by the lpstrText member must be large enough to receive all characters and the terminating null character.

 

Constants

TopicContents
Rich Edit Control Event Mask Flags

The event mask specifies which notification codes a rich edit control sends to its parent window.

Rich Edit Control Styles

Describes the window styles that are unique to rich edit controls.

 

 

 

Community Additions

ADD
Show:
© 2014 Microsoft