From c65f4c495684380d67ff169ddade3f57b9d7cd69 Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Mon, 13 Dec 2010 16:00:29 +0100 Subject: [PATCH] mshtml: Added support for plugin in place activation. --- dlls/mshtml/pluginhost.c | 28 ++++++++++++++++++++++++---- dlls/mshtml/pluginhost.h | 1 + 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/dlls/mshtml/pluginhost.c b/dlls/mshtml/pluginhost.c index 5b8ab718072..8a7e2a65c4e 100644 --- a/dlls/mshtml/pluginhost.c +++ b/dlls/mshtml/pluginhost.c @@ -298,6 +298,8 @@ static ULONG WINAPI PHClientSite_Release(IOleClientSite *iface) TRACE("(%p) ref=%d\n", This, ref); if(!ref) { + if(This->ip_object) + IOleInPlaceObject_Release(This->ip_object); list_remove(&This->entry); if(This->element) This->element->plugin_host = NULL; @@ -351,8 +353,10 @@ static HRESULT WINAPI PHClientSite_GetContainer(IOleClientSite *iface, IOleConta static HRESULT WINAPI PHClientSite_ShowObject(IOleClientSite *iface) { PluginHost *This = impl_from_IOleClientSite(iface); - FIXME("(%p)\n", This); - return E_NOTIMPL; + + TRACE("(%p)\n", This); + + return S_OK; } static HRESULT WINAPI PHClientSite_OnShowWindow(IOleClientSite *iface, BOOL fShow) @@ -684,8 +688,24 @@ static HRESULT WINAPI PHInPlaceSite_OnPosRectChange(IOleInPlaceSiteEx *iface, LP static HRESULT WINAPI PHInPlaceSiteEx_OnInPlaceActivateEx(IOleInPlaceSiteEx *iface, BOOL *pfNoRedraw, DWORD dwFlags) { PluginHost *This = impl_from_IOleInPlaceSiteEx(iface); - FIXME("(%p)->(%p %x)\n", This, pfNoRedraw, dwFlags); - return E_NOTIMPL; + HWND hwnd; + HRESULT hres; + + TRACE("(%p)->(%p %x)\n", This, pfNoRedraw, dwFlags); + + if(This->ip_object) + return S_OK; + + hres = IUnknown_QueryInterface(This->plugin_unk, &IID_IOleInPlaceObject, (void**)&This->ip_object); + if(FAILED(hres)) + return hres; + + hres = IOleInPlaceObject_GetWindow(This->ip_object, &hwnd); + if(SUCCEEDED(hres)) + FIXME("Use hwnd %p\n", hwnd); + + *pfNoRedraw = FALSE; + return S_OK; } static HRESULT WINAPI PHInPlaceSiteEx_OnInPlaceDeactivateEx(IOleInPlaceSiteEx *iface, BOOL fNoRedraw) diff --git a/dlls/mshtml/pluginhost.h b/dlls/mshtml/pluginhost.h index ee1fed64d1d..30af989f3ba 100644 --- a/dlls/mshtml/pluginhost.h +++ b/dlls/mshtml/pluginhost.h @@ -31,6 +31,7 @@ typedef struct { LONG ref; IUnknown *plugin_unk; + IOleInPlaceObject *ip_object; CLSID clsid; HWND hwnd; RECT rect;