From feed9d47504a11bd4b29286a12da21d0496a566d Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Mon, 4 Apr 2016 18:01:46 +0200 Subject: [PATCH] mshtml: Added IHTMLWindow6::onmessage property implementation. Signed-off-by: Jacek Caban Signed-off-by: Alexandre Julliard --- dlls/mshtml/htmlevent.c | 5 +++++ dlls/mshtml/htmlevent.h | 1 + dlls/mshtml/htmlwindow.c | 12 ++++++++---- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/dlls/mshtml/htmlevent.c b/dlls/mshtml/htmlevent.c index afacf719bcd..2226278206a 100644 --- a/dlls/mshtml/htmlevent.c +++ b/dlls/mshtml/htmlevent.c @@ -102,6 +102,9 @@ static const WCHAR onkeyupW[] = {'o','n','k','e','y','u','p',0}; static const WCHAR loadW[] = {'l','o','a','d',0}; static const WCHAR onloadW[] = {'o','n','l','o','a','d',0}; +static const WCHAR messageW[] = {'m','e','s','s','a','g','e',0}; +static const WCHAR onmessageW[] = {'o','n','m','e','s','s','a','g','e',0}; + static const WCHAR mousedownW[] = {'m','o','u','s','e','d','o','w','n',0}; static const WCHAR onmousedownW[] = {'o','n','m','o','u','s','e','d','o','w','n',0}; @@ -210,6 +213,8 @@ static const event_info_t event_info[] = { EVENT_DEFAULTLISTENER|EVENT_BUBBLE}, {loadW, onloadW, EVENTT_HTML, DISPID_EVMETH_ONLOAD, EVENT_BIND_TO_BODY}, + {messageW, onmessageW, EVENTT_NONE, DISPID_EVMETH_ONMESSAGE, + EVENT_FORWARDBODY /* FIXME: remove when we get the target right */ }, {mousedownW, onmousedownW, EVENTT_MOUSE, DISPID_EVMETH_ONMOUSEDOWN, EVENT_DEFAULTLISTENER|EVENT_BUBBLE|EVENT_CANCELABLE}, {mousemoveW, onmousemoveW, EVENTT_MOUSE, DISPID_EVMETH_ONMOUSEMOVE, diff --git a/dlls/mshtml/htmlevent.h b/dlls/mshtml/htmlevent.h index 05c2b84c4eb..f723ef64040 100644 --- a/dlls/mshtml/htmlevent.h +++ b/dlls/mshtml/htmlevent.h @@ -36,6 +36,7 @@ typedef enum { EVENTID_KEYPRESS, EVENTID_KEYUP, EVENTID_LOAD, + EVENTID_MESSAGE, EVENTID_MOUSEDOWN, EVENTID_MOUSEMOVE, EVENTID_MOUSEOUT, diff --git a/dlls/mshtml/htmlwindow.c b/dlls/mshtml/htmlwindow.c index f2034055cdc..ec333bc0743 100644 --- a/dlls/mshtml/htmlwindow.c +++ b/dlls/mshtml/htmlwindow.c @@ -2148,15 +2148,19 @@ static HRESULT WINAPI HTMLWindow6_toStaticHTML(IHTMLWindow6 *iface, BSTR bstrHTM static HRESULT WINAPI HTMLWindow6_put_onmessage(IHTMLWindow6 *iface, VARIANT v) { HTMLWindow *This = impl_from_IHTMLWindow6(iface); - FIXME("(%p)->(%s)\n", This, debugstr_variant(&v)); - return E_NOTIMPL; + + TRACE("(%p)->(%s)\n", This, debugstr_variant(&v)); + + return set_window_event(This, EVENTID_MESSAGE, &v); } static HRESULT WINAPI HTMLWindow6_get_onmessage(IHTMLWindow6 *iface, VARIANT *p) { HTMLWindow *This = impl_from_IHTMLWindow6(iface); - FIXME("(%p)->(%p)\n", This, p); - return E_NOTIMPL; + + TRACE("(%p)->(%p)\n", This, p); + + return get_window_event(This, EVENTID_MESSAGE, p); } static HRESULT WINAPI HTMLWindow6_msWriteProfilerMark(IHTMLWindow6 *iface, BSTR bstrProfilerMark)