richedit: Move message handling to function callable without window.

Dylan Smith dylan.ah.smith at
Fri Dec 19 09:57:28 CST 2008

In order to make the message handling available to windowless richedit
controls, the message handling must be in a function that can be called
from the ITextServices_TxSendMessage method.  This method will never
have a handle to a window to pass to RichEditWndProc_common in order to
get the editor with GetWindowLongPtrW, but passing the editor will work
(even if hWnd is NULL).

The new function, ME_HandleMessage also includes an additional return
value for the HRESULT returned by ITextServices_TxSendMessage.  This can
provide additional error information such as E_OUTOFMEMORY, S_FALSE
(message not processed), or S_MSG_KEYIGNORED (no action for keystroke).

There is still plenty of work that this patch doesn't cover. The general
strategy will be to provide an implementation of ITextHost for windowed
richedit controls, and then use this to remove dependance on having
direct access to the window handle.  This would then allow ITextServices
to be implemented by providing the user supplied ITextHost
implementation, and the existing richedit code.
 dlls/riched20/editor.c |  132 +++++++++++++++++++++++++++++------------------
 dlls/riched20/editor.h |    2 +
 2 files changed, 83 insertions(+), 51 deletions(-)
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 0001-richedit-Move-message-handling-to-function-calla.diff.txt

More information about the wine-patches mailing list