SUMMARY
The WindowlessRE sample demonstrates how to create and
implement a windowless rich edit control. The sample shows how to:
- Implement the ITextHost interface.
- Use the CreateTextServices function to retrieve a pointer to an ITextServices interface provided by the Richedit20.dll file.
- Handle messages that route and paint for the
control.
Windowless rich edit controls are supported by the
Richedit20.dll file. To create a windowless rich edit control, you must call
the
CreateTextServices function, passing a pointer to your
ITextHost implementation. The
ITextHost interface provides such functionality as user interface (UI)
activation, host notification, painting services, and an
ITextEditControl interface. The
CreateTextServices function returns an
IUnknown pointer that can be queried for the
ITextServices interface.
Similar to all windowless controls, the
windowless rich edit control must be contained by a window that is capable of
routing messages to and from the windowless rich edit control.
Windowless controls are useful in situations where the overhead of a standard
windowed control may not be desirable. Some benefits of windowless objects are:
- They can be transparent.
- They reduce overall size of the object in
memory.
- They allow an object to be nonrectangular.