ITextHost::TxNotify method (textserv.h)

Notifies the text host of various events.

Syntax

HRESULT TxNotify(
  [in] DWORD iNotify,
  [in] void  *pv
);

Parameters

[in] iNotify

Type: DWORD

Event to notify host of. One of the EN_ notification codes.

[in] pv

Type: void*

Extra data, dependent on iNotify.

Return value

Type: HRESULT

Return S_OK if the method succeeds.

Return S_FALSE if the method fails. For more information on COM error codes, see Error Handling in COM.

Remarks

Note that there are two basic categories of events, direct and delayed . Direct events are sent immediately because they need some processing, for example, EN_PROTECTED. Delayed events are sent after all processing has occurred; the control is thus in a stable state. Examples of delayed notifications are EN_CHANGE, EN_ERRSPACE, and EN_SELCHANGE.

The notification events are the same as the notification codes sent to the parent window of a rich edit window. The firing of events may be controlled with a mask set through the EM_SETEVENTMASK message.

In general, it is legal to make calls to the text services object while processing this method; however, implementers are cautioned to avoid excessive recursion.

The following is a list of the notifications that may be sent.

Notification Meaning
EN_CHANGE Sent after the system updates the screen, when the user takes an action that may have altered text in the control.
EN_DROPFILES Sent when either a WM_DROPFILES message or an IDropTarget::DragEnter notification is received.
EN_ERRSPACE Sent when a control cannot allocate enough memory to meet a specified request.
EN_HSCROLL Sent when the user clicks the control's horizontal scroll bar before the screen is updated.
EN_KILLFOCUS Sent when the control loses the keyboard focus.
EN_LINK Sent when a rich edit control receives various messages, such as mouse click messages, when the mouse pointer is over text that has the CFE_LINK effect.
EN_MAXTEXT Sent when the current text insertion has exceeded the maximum number of characters for the control.
EN_OLEOPFAILED Sent when a user action on an OLE object has failed.
EN_PROTECTED Sent when the user takes an action that changes the protected range of text.
EN_REQUESTRESIZE Sent when a rich edit control's contents are different from the control's window size.
EN_SAVECLIPBOARD Sent when an edit control is being destroyed. The text host should indicate whether OleFlushClipboard should be called. Data indicating the number of characters and objects to be flushed is sent in the ENSAVECLIPBOARD data structure. Mask value is nothing.
EN_SELCHANGE Sent when the current selection has changed. A SELCHANGE data structure is also sent, which indicates the new selection range at the type of data the selection is currently over. Controlled through the ENM_SELCHANGE mask.
EN_SETFOCUS Sent when the edit control receives the keyboard focus. No extra data is sent; there is no mask.
EN_STOPNOUNDO Sent when an action occurs for which the control cannot allocate enough memory to maintain the undo state. If S_FALSE is returned, the action will be stopped; otherwise, the action will continue.
EN_UPDATE Sent before an edit control requests a redraw of altered data or text. No additional data is sent. This event is controlled through the ENM_UPDATE mask. Rich Edit 2.0 and later: The ENM_UPDATE mask is ignored and the EN_UPDATE notification code is always sent. However, when Microsoft Rich Edit 3.0 emulates Microsoft Rich Edit 1.0, the ENM_UPDATE mask controls this notification.
EN_VSCROLL Sent when the user clicks an edit control's vertical scroll bar or when the user scrolls the mouse wheel over the edit control, before the screen is updated. This is controlled through the ENM_SCROLL mask; no extra data is sent.
 
Note  The EN_MSGFILTER is not sent to TxNotify. To filter window messages, use TxSendMessage.
 

Requirements

Requirement Value
Minimum supported client Windows Vista [desktop apps only]
Minimum supported server Windows Server 2003 [desktop apps only]
Target Platform Windows
Header textserv.h
DLL Msftedit.dll

See also

Conceptual

EM_SETEVENTMASK

EN_CHANGE

EN_DROPFILES

EN_ERRSPACE

EN_HSCROLL

EN_KILLFOCUS

EN_LINK

EN_MAXTEXT

EN_OLEOPFAILED

EN_PROTECTED

EN_REQUESTRESIZE

EN_SAVECLIPBOARD

EN_SELCHANGE

EN_SETFOCUS

EN_STOPNOUNDO

EN_UPDATE

EN_VSCROLL

ITextHost

Reference

Windowless Rich Edit Controls