ITextServices Class

Extends the Text Object Model (TOM) to provide extra functionality for windowless operation.


The ITextServices class has these methods.

Method Description
ITextServices::OnTxInPlaceActivate Notifies the text services object that this control is in-place active.
ITextServices::OnTxInPlaceDeactivate Notifies the text services object that this control is no longer in-place active.
ITextServices::OnTxPropertyBitsChange Sets properties (represented by bits) for the control.
ITextServices::OnTxSetCursor Notifies the text services object to set the cursor.
ITextServices::OnTxUIActivate Informs the text services object that the control is now UI active.
ITextServices::OnTxUIDeactivate Informs the text services object that the control is no longer UI active.
ITextServices::TxDraw Draws the text services object.
ITextServices::TxGetBaseLinePos Gets the base line position of the first visible line, in pixels, relative to the text services client rectangle. This permits aligning controls on their base lines.
ITextServices::TxGetCachedSize Returns the cached drawing logical size (if any) that text services is using. Typically, this will be the size of the last client rectangle used in ITextServices::TxDraw, ITextServices::OnTxSetCursor, and so forth, although it is not guaranteed to be.
ITextServices::TxGetCurTargetX Gets the target x position, that is, the current horizontal position of the caret.
ITextServices::TxGetDropTarget Gets the drop target for the text control.
ITextServices::TxGetHScroll Returns horizontal scroll bar information.
ITextServices::TxGetNaturalSize Allows a control to be resized so it fits its content appropriately.
ITextServices::TxGetText Returns all of the Unicode plain text in the control as a BSTR.
ITextServices::TxGetVScroll Returns vertical scroll bar state information.
ITextServices::TxQueryHitPoint Tests whether a specified point is within the rectangle of the text services object.
ITextServices::TxSendMessage Used by the window host to forward messages sent from its window to the text services object.
ITextServices::TxSetText Sets all of the text in the control.


In conjunction with the ITextHost interface, ITextServices provides the means by which a rich edit control can be used without creating a window.

When to Implement

Applications do not implement the ITextServices interface.

When to Use

Applications can call the CreateTextServices function to create a text services object. To retrieve an ITextServices pointer, call QueryInterface on the private IUnknown pointer returned by CreateTextServices. You can then call the ITextServices methods to send messages to the text services object.


Minimum supported client Windows Vista [desktop apps only]
Minimum supported server Windows Server 2003 [desktop apps only]
Target Platform Windows
Header textserv.h

See Also

Windowless Rich Edit Controls Overview