From 9c4f120e88668e3ca66b7f36bad80f491df9e870 Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Fri, 28 Apr 2006 23:45:36 +0200 Subject: [PATCH] shdocvw: Added WebBrowser::[get|put]_MenuBar implementation. --- dlls/shdocvw/shdocvw.h | 1 + dlls/shdocvw/webbrowser.c | 22 ++++++++++++++++++---- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/dlls/shdocvw/shdocvw.h b/dlls/shdocvw/shdocvw.h index 11a9b26f0ab..45088b3c91a 100644 --- a/dlls/shdocvw/shdocvw.h +++ b/dlls/shdocvw/shdocvw.h @@ -116,6 +116,7 @@ typedef struct { HWND shell_embedding_hwnd; VARIANT_BOOL visible; + VARIANT_BOOL menu_bar; DocHost doc_host; } WebBrowser; diff --git a/dlls/shdocvw/webbrowser.c b/dlls/shdocvw/webbrowser.c index f6d82b2ba4e..6dc830269c6 100644 --- a/dlls/shdocvw/webbrowser.c +++ b/dlls/shdocvw/webbrowser.c @@ -559,15 +559,28 @@ static HRESULT WINAPI WebBrowser_put_ToolBar(IWebBrowser2 *iface, int Value) static HRESULT WINAPI WebBrowser_get_MenuBar(IWebBrowser2 *iface, VARIANT_BOOL *Value) { WebBrowser *This = WEBBROWSER_THIS(iface); - FIXME("(%p)->(%p)\n", This, Value); - return E_NOTIMPL; + + TRACE("(%p)->(%p)\n", This, Value); + + *Value = This->menu_bar; + return S_OK; } static HRESULT WINAPI WebBrowser_put_MenuBar(IWebBrowser2 *iface, VARIANT_BOOL Value) { WebBrowser *This = WEBBROWSER_THIS(iface); - FIXME("(%p)->(%x)\n", This, Value); - return E_NOTIMPL; + VARIANTARG arg; + DISPPARAMS dispparams = {&arg, NULL, 1, 0}; + + TRACE("(%p)->(%x)\n", This, Value); + + This->menu_bar = Value; + + V_VT(&arg) = VT_BOOL; + V_BOOL(&arg) = Value; + call_sink(This->doc_host.cp_wbe2, DISPID_ONMENUBAR, &dispparams); + + return S_OK; } static HRESULT WINAPI WebBrowser_get_FullScreen(IWebBrowser2 *iface, VARIANT_BOOL *pbFullScreen) @@ -860,6 +873,7 @@ HRESULT WebBrowser_Create(IUnknown *pOuter, REFIID riid, void **ppv) DocHost_Init(&ret->doc_host, (IDispatch*)WEBBROWSER2(ret)); ret->visible = VARIANT_TRUE; + ret->menu_bar = VARIANT_TRUE; WebBrowser_OleObject_Init(ret); WebBrowser_ViewObject_Init(ret);