Richedit 컨트롤에 Url 링크 설정 처리
원문 위치
Rich Edit Controls |
This section contains information about the programming elements used with rich edit controls. A rich edit control is a window in which the user can enter, edit, format, print, and save text. The text can be assigned character and paragraph formatting, and can include embedded Component Object Model (COM) objects. Rich edit controls support almost all of the messages and notification messages used with multiline edit controls. Thus, applications that already use edit controls can be easily changed to use rich edit controls. Additional messages and notifications enable applications to access the functionality unique to rich edit controls. Beginning with Microsoft Rich Edit 2.0, there is also single line or multiline capabilities and plain or rich text. For information about edit controls, see Edit Controls.
Overviews
About Rich Edit ControlsThis section discusses rich edit controls.
Functions
EditStreamCallbackThe 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. The EDITSTREAMCALLBACK type defines a pointer to this callback function. EditStreamCallback is a placeholder for the application-defined function name.
EditWordBreakProcExThe 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. The EDITWORDBREAKPROCEX type defines a pointer to this callback function. EditWordBreakProcEx is a placeholder for the application-defined function name.
HyphenateProcThe HyphenateProc function is an application–defined callback function used with the EM_SETHYPHENATEINFO message. It determines how hyphenation is done in a Rich Edit control.
HyphenateProc is a placeholder for the application
Interfaces
IRichEditOleThe IRichEditOle interface specifies an interface used by the client of a rich text edit control to carry out OLE-related operations. The IRichEditOle interface also supports the ITextDocument interface. For more information on this, see Interface from Window Messages.
Note A client must release an IRichEditOle pointer before destroying an instance of RichEdit.The IRichEditOle interface has the following methods.
IRichEditOleCallbackThe IRichEditOleCallback interface specifies an interface 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. The IRichEditOleCallback interface has the following methods.
Messages
EM_AUTOURLDETECTAn EM_AUTOURLDETECT message enables or disables automatic detection of URLs by a rich edit control.
EM_CANPASTEThe EM_CANPASTE message determines whether a rich edit control can paste a specified clipboard format.
EM_CANREDOThe EM_CANREDO message determines whether there are any actions in the control redo queue.
EM_DISPLAYBANDThe EM_DISPLAYBAND message displays a portion of the contents of a rich edit control, as previously formatted for a device using the EM_FORMATRANGE message.
EM_EXGETSELThe EM_EXGETSEL message retrieves the starting and ending character positions of the selection in a rich edit control.
EM_EXLIMITTEXTThe EM_EXLIMITTEXT message sets an upper limit to the amount of text the user can type or paste into a rich edit control.
EM_EXLINEFROMCHARThe EM_EXLINEFROMCHAR message determines which line contains the specified character in a rich edit control.
EM_EXSETSELThe EM_EXSETSEL message selects a range of characters and/or COM objects in a Rich Edit control.
EM_FINDTEXTThe EM_FINDTEXT message finds text within a rich edit control.
EM_FINDTEXTEXThe EM_FINDTEXTEX message finds text within a rich edit control.
EM_FINDTEXTEXWThe EM_FINDTEXTEXW message is the Unicode version of the EM_FINDTEXTEX message It is used to locate text within the edit control.
EM_FINDTEXTWThe EM_FINDTEXTW message is the Unicode version of the EM_FINDTEXT message. It is used to locate text within the edit control.
EM_FINDWORDBREAKThe EM_FINDWORDBREAK message finds the next word break before or after the specified character position or retrieves information about the character at that position.
EM_FORMATRANGEThe EM_FORMATRANGE message formats a range of text in a rich edit control for a specific device.
EM_GETAUTOURLDETECTThe EM_GETAUTOURLDETECT message indicates whether the auto URL detection is turned on in the rich edit control.
EM_GETBIDIOPTIONSThe EM_GETBIDIOPTIONS message indicates the current state of the bidirectional options in the rich edit control.
EM_GETCHARFORMATThe EM_GETCHARFORMAT message determines the current character formatting in a rich edit control.
EM_GETCTFMODEBIASAn application sends a EM_GETCTFMODEBIAS message to get the Text Services Framework mode bias values for a Rich Edit control.
EM_GETCTFOPENSTATUSAn application sends an EM_GETCTFOPENSTATUS message to determine if the Text Services Framework (TSF) keyboard is open or closed.
EM_GETEDITSTYLEThe EM_GETEDITSTYLE message retrieves the current edit style flags.
EM_GETEVENTMASKThe EM_GETEVENTMASK message retrieves the event mask for a rich edit control. The event mask specifies which notification messages the control sends to its parent window.
EM_GETHYPHENATEINFOAn application sends an EM_GETHYPHENATEINFO message to get information about hyphenation for a Rich Edit control.
EM_GETIMECOLORThe EM_GETIMECOLOR message retrieves the Input Method Editor (IME) composition color. This message is available only in Asian-language versions of the operating system.
EM_GETIMECOMPMODEAn application sends an EM_GETIMECOMPMODE message to get the current IME mode for a rich edit control.
EM_GETIMECOMPTEXTAn application sends an EM_GETIMECOMPTEXT message to get the IME composition text.
EM_GETIMEMODEBIASAn application sends an EM_GETIMEMODEBIAS message to get the IME mode bias for a Rich Edit control.
EM_GETIMEOPTIONSThe EM_GETIMEOPTIONS message retrieves the current IME options. This message is available only in Asian-language versions of the operating system.
EM_GETIMEPROPERTYAn application sends a EM_GETIMEPROPERTY message to get the property and capabilities of the IME associated with the current input locale.
EM_GETLANGOPTIONSAn application sends an EM_GETLANGOPTIONS message to get a rich edit control's option settings for IME and Asian language support.
EM_GETOLEINTERFACEThe EM_GETOLEINTERFACE message retrieves an IRichEditOle object that a client can use to access a rich edit control's COM functionality.
EM_GETOPTIONSThe EM_GETOPTIONS message retrieves rich edit control options.
EM_GETPAGEROTATEDeprecated. An application sends an EM_GETPAGEROTATE message to get the text layout for a Rich Edit control.
EM_GETPARAFORMATThe EM_GETPARAFORMAT message retrieves the paragraph formatting of the current selection in a rich edit control.
EM_GETPUNCTUATIONThe EM_GETPUNCTUATION message gets the current punctuation characters for the rich edit control. This message is available only in Asian-language versions of the operating system.
EM_GETREDONAMEAn application sends an EM_GETREDONAME message to a rich edit control to retrieve the type of the next action, if any, in the control's redo queue.
To send this message, call the SendMessage function with the following parameters.
EM_GETSCROLLPOSAn application sends an EM_GETSCROLLPOS message to obtain the current scroll position of the edit control.
EM_GETSELTEXTThe EM_GETSELTEXT message retrieves the currently selected text in a rich edit control.
EM_GETTEXTEXThe EM_GETTEXTEX message allows you to get all of the text from the rich edit control in any particular code base you want.
EM_GETTEXTLENGTHEXThe EM_GETTEXTLENGTHEX message calculates text length in various ways. It is usually called before creating a buffer to receive the text from the control.
EM_GETTEXTMODEAn application sends an EM_GETTEXTMODE message to get the current text mode and undo level of a rich edit control.
EM_GETTEXTRANGEThe EM_GETTEXTRANGE message retrieves a specified range of characters from a rich edit control.
EM_GETTYPOGRAPHYOPTIONSThe EM_GETTYPOGRAPHYOPTIONS message returns the current state of the typography options of a rich edit control.
EM_GETUNDONAMERich Edit 2.0 and later: An application sends an EM_GETUNDONAME message to a rich edit control to retrieve the type of the next undo action, if any.
Rich Edit 1.0: This message is not supported.
To send this message, call the SendMessage function with the following parameters.
EM_GETWORDBREAKPROCEXThe EM_GETWORDBREAKPROCEX message retrieves the address of the currently registered extended word-break procedure.
EM_GETWORDWRAPMODEThe EM_GETWORDWRAPMODE message 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_GETZOOMThe EM_GETZOOM message gets the current zoom ratio, which is always between 1/64 and 64.
EM_HIDESELECTIONThe EM_HIDESELECTION message hides or shows the selection in a rich edit control.
EM_ISIMEAn application sends a EM_ISIME message to determine if current input locale is an East Asian locale.
EM_PASTESPECIALThe EM_PASTESPECIAL message pastes a specific clipboard format in a rich edit control.
EM_RECONVERSIONThe EM_RECONVERSION message invokes the IME reconversion dialog box.
EM_REDOSend an EM_REDO message to a rich edit control to redo the next action in the control's redo queue.
EM_REQUESTRESIZEThe EM_REQUESTRESIZE message forces a rich edit control to send an EN_REQUESTRESIZE notification message to its parent window.
EM_SELECTIONTYPEThe EM_SELECTIONTYPE message determines the selection type for a rich edit control.
EM_SETBIDIOPTIONSThe EM_SETBIDIOPTIONS message sets the current state of the bidirectional options in the rich edit control.
EM_SETBKGNDCOLORThe EM_SETBKGNDCOLOR message sets the background color for a rich edit control.
EM_SETCHARFORMATThe EM_SETCHARFORMAT message sets character formatting in a rich edit control.
EM_SETCTFMODEBIASAn application sends an EM_SETCTFMODEBIAS message to set the Text Services Framework (TSF) mode bias for a Rich Edit control.
EM_SETCTFOPENSTATUSAn application sends an EM_SETCTFOPENSTATUS message to open or close the Text Services Framework (TSF) keyboard.
EM_SETEDITSTYLEThe EM_SETEDITSTYLE message sets the current edit style flags.
EM_SETEVENTMASKThe EM_SETEVENTMASK message sets the event mask for a rich edit control. The event mask specifies which notification messages the control sends to its parent window.
EM_SETFONTSIZEThe EM_SETFONTSIZE message sets the font size for the selected text.
EM_SETHYPHENATEINFOAn application sends an EM_SETHYPHENATEINFO message to set the way a Rich Edit control does hyphenation.
EM_SETIMECOLORThe EM_SETIMECOLOR message sets the IME composition color. This message is available only in Asian-language versions of the operating system.
EM_SETIMEMODEBIASAn application sends an EM_SETIMEMODEBIAS message to set the IME mode bias for a Rich Edit control.
EM_SETIMEOPTIONSThe EM_SETIMEOPTIONS message sets the IME options. This message is available only in Asian-language versions of the operating system.
EM_SETLANGOPTIONSAn application sends an EM_SETLANGOPTIONS message to set options for IME and Asian language support in a rich edit control.
EM_SETOLECALLBACKThe EM_SETOLECALLBACK message gives a rich edit control an IRichEditOleCallback object that the control uses to get OLE-related resources and information from the client.
EM_SETOPTIONSThe EM_SETOPTIONS message sets the options for a rich edit control.
EM_SETPAGEROTATEDeprecated. An application sends an EM_SETPAGEROTATE message to set the text layout for a Rich Edit control.
EM_SETPALETTEAn application sends an EM_SETPALETTE message to change the palette that rich edit uses for its display window.
EM_SETPARAFORMATThe EM_SETPARAFORMAT message sets the paragraph formatting for the current selection in a rich edit control.
EM_SETPUNCTUATIONThe EM_SETPUNCTUATION message sets the punctuation characters for a rich edit control. This message is available only in Asian-language versions of the operating system.
EM_SETSCROLLPOSAn application sends an EM_SETSCROLLPOS message to tell the rich edit control to scroll to a particular point.
EM_SETTARGETDEVICEThe EM_SETTARGETDEVICE message sets the target device and line width used for WYSIWYG formatting in a rich edit control.
EM_SETTEXTEXThe EM_SETTEXTEX message 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 Format (RTF) rich text or plain text.
EM_SETTEXTMODEAn application sends an EM_SETTEXTMODE message to set the text mode or undo level of a rich edit control. The message fails if the control contains any text.
EM_SETTYPOGRAPHYOPTIONSThe EM_SETTYPOGRAPHYOPTIONS message sets the current state of the typography options of a rich edit control.
EM_SETUNDOLIMITAn application sends an EM_SETUNDOLIMIT message to a rich edit control to set the maximum number of actions that can stored in the undo queue.
EM_SETWORDBREAKPROCEXThe EM_SETWORDBREAKPROCEX message sets the extended word-break procedure.
EM_SETWORDWRAPMODEThe EM_SETWORDWRAPMODE message 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_SETZOOMThe EM_SETZOOM message sets the zoom ratio anywhere between 1/64 and 64.
EM_SHOWSCROLLBARThe EM_SHOWSCROLLBAR message shows or hides one of the scroll bars in the Text Host window.
EM_STOPGROUPTYPINGAn application sends an EM_STOPGROUPTYPING message to a rich edit control to stop 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_STREAMINThe EM_STREAMIN message replaces the contents of a rich edit control with a stream of data provided by an application defined
EM_STREAMOUTThe EM_STREAMOUT message causes a rich edit control to pass its contents to an application
Notifications
EN_ALIGNLTRThe EN_ALIGNLTR notification message 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 message in the form of a WM_COMMAND message.
EN_ALIGNRTLThe EN_ALIGNRTL notification message notifies a rich edit control's parent window that the paragraph direction changed to right-to-left. A rich edit control sends this notification message in the form of a WM_COMMAND message.
EN_CORRECTTEXTThe EN_CORRECTTEXT message notifies a rich edit control 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 message in the form of a WM_NOTIFY message.
EN_DRAGDROPDONEThe EN_DRAGDROPDONE notification message notifies a rich edit control's parent window that the drag-and-drop operation has completed. A rich edit control sends this notification message in the form of a WM_NOTIFY message.
EN_DROPFILESThe EN_DROPFILES message notifies a rich edit control parent window that the user is attempting to drop files into the control. A rich edit control sends this notification message in the form of a WM_NOTIFY message when it receives the WM_DROPFILES message.
EN_IMECHANGEThe EN_IMECHANGE message 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 message in the form of a WM_COMMAND message.
EN_LINKA rich edit control sends EN_LINK messages when it receives various messages, for example, 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 message through a WM_NOTIFY message.
EN_LOWFIRTFThe EN_LOWFIRTF notification message notifies the parent window of a Rich Edit control that an unsupported RTF keyword was received. A Rich Edit control sends this notification message in the form of a WM_NOTIFY message.
EN_MSGFILTERThe EN_MSGFILTER message notifies a rich edit control's parent window of a keyboard or mouse event in the control. A rich edit control sends this notification message in the form of a WM_NOTIFY message.
EN_OBJECTPOSITIONSThe EN_OBJECTPOSITIONS notification message notifies a rich edit control's parent window when the control reads in objects. A rich edit control sends this notification message in the form of a WM_NOTIFY message.
EN_OLEOPFAILEDThe EN_OLEOPFAILED message 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 message in the form of a WM_NOTIFY message.
EN_PROTECTEDThe EN_PROTECTED message 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 message in the form of a WM_NOTIFY message.
EN_REQUESTRESIZEThe EN_REQUESTRESIZE message 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 message in the form of a WM_NOTIFY message.
EN_SAVECLIPBOARDThe EN_SAVECLIPBOARD message 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 message in the form of a WM_NOTIFY message.
EN_SELCHANGEThe EN_SELCHANGE message notifies a rich edit control's parent window that the current selection has changed. A rich edit control sends this notification message in the form of a WM_NOTIFY message.
EN_STOPNOUNDOThe EN_STOPNOUNDO message 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 message in the form of a WM_NOTIFY message.
Structures
BIDIOPTIONSThe BIDIOPTIONS structure 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.
CHARFORMATThe CHARFORMAT structure contains information about character formatting in a rich edit control.
Rich Edit 2.0: The CHARFORMAT2 structure is a Rich Edit 2.0 extension of the CHARFORMAT structure. Rich Edit 2.0 and later allows you to use either structure with the EM_GETCHARFORMAT and EM_SETCHARFORMAT messages.
CHARFORMAT2The CHARFORMAT2 structure contains information about character formatting in a rich edit control. CHARFORMAT2 is a Rich Edit 2.0 extension of the CHARFORMAT structure. Rich Edit 2.0 allows you to use either structure with the EM_GETCHARFORMAT and EM_SETCHARFORMAT messages.
CHARRANGEThe CHARRANGE structure specifies a range of characters in a rich edit control. This structure is used with the EM_EXGETSEL and EM_EXSETSEL messages.
If the cpMin and cpMax members are equal, the range is empty. The range includes everything if cpMin is 0 and cpMax is
COMPCOLORThe COMPCOLOR structure contains color settings for a composition string.
EDITSTREAMThe EDITSTREAM structure 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.
ENCORRECTTEXTThe ENCORRECTTEXT structure contains information about the selected text to be corrected.
ENDROPFILESThe ENDROPFILES structure contains information associated with an EN_DROPFILES notification message. A rich edit control sends this notification message when it receives a WM_DROPFILES message.
ENLINKThe ENLINK structure contains information about an EN_LINK notification message from a rich edit control.
ENLOWFIRTFThe ENLOWFIRTF structure contains information about an unsupported RTF keyword in a Rich Edit control.
ENOLEOPFAILEDThe ENOLEOPFAILED structure contains information about a failed operation.
ENPROTECTEDThe ENPROTECTED structure contains information associated with an EN_PROTECTED notification message. A rich edit control sends this notification when the user attempts to edit protected text.
ENSAVECLIPBOARDThe ENSAVECLIPBOARD structure contains information about objects and text on the clipboard.
FINDTEXTThe FINDTEXT structure contains information about a search operation in a rich edit control. This structure is used with the EM_FINDTEXT message.
FINDTEXTEXThe FINDTEXTEX structure contains information about text to search for in a rich edit control. This structure is used with the EM_FINDTEXTEX message.
FORMATRANGEThe FORMATRANGE structure 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.
GETTEXTEXThe GETTEXTEX structure 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.
GETTEXTLENGTHEXThe GETTEXTLENGTHEX structure 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.
HYPHENATEINFOThe HYPHENATEINFO structure contains information about hyphenation in a Rich Edit control.
HYPHRESULTThe HYPHRESULT structure contains information about the result of hyphenation in a Rich Edit control.
IMECOMPTEXTThe IMECOMPTEXT structure contains information about the composition text in a Rich Edit control.
MSGFILTERThe MSGFILTER structure 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 message, enabling the parent to change the message or prevent it from being processed.
OBJECTPOSITIONSThe OBJECTPOSITIONS structure contains object position information.
PARAFORMATThe PARAFORMAT structure contains information about paragraph formatting attributes in a rich edit control. This structure is used with the EM_GETPARAFORMAT and EM_SETPARAFORMAT messages.
In Rich Edit 2.0, the PARAFORMAT2 structure is a Rich Edit 2.0 extension of the PARAFORMAT structure. Rich Edit 2.0 allows you to use either structure with EM_GETPARAFORMAT and EM_SETPARAFORMAT.
PARAFORMAT2The PARAFORMAT2 structure contains information about paragraph formatting attributes in a rich edit control. PARAFORMAT2 is a Rich Edit 2.0 extension of the PARAFORMAT structure. Rich Edit 2.0 allows you to use either structure with the EM_GETPARAFORMAT and EM_SETPARAFORMAT messages.
PUNCTUATIONThe PUNCTUATION structure contains information about the punctuation used in a rich edit control.
REOBJECTThe REOBJECT structure contains information about an object.
REPASTESPECIALThe REPASTESPECIAL structure 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.
REQRESIZEThe REQRESIZE structure 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 message.
SELCHANGEThe SELCHANGE structure contains information associated with an EN_SELCHANGE notification message. A rich edit control sends this notification to its parent window when the current selection changes.
SETTEXTEXThe SETTEXTEX structure 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.
TEXTRANGEThe TEXTRANGE structure 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
Rich Edit Control Event Mask FlagsThe event mask specifies which notification messages a rich edit control sends to its parent window. The event mask can be none or a combination of these values.
Rich Edit Control StylesThe following window styles are unique to rich edit controls.