Commit 5bce6044 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

mshtml: Do more initialization in create_plugin_host.

parent 2ff98732
...@@ -182,7 +182,7 @@ static void load_plugin(PluginHost *host) ...@@ -182,7 +182,7 @@ static void load_plugin(PluginHost *host)
FIXME("No IPersistPropertyBag iface\n"); FIXME("No IPersistPropertyBag iface\n");
} }
static void activate_plugin(PluginHost *host) static void initialize_plugin_object(PluginHost *host)
{ {
IClientSecurity *client_security; IClientSecurity *client_security;
IQuickActivate *quick_activate; IQuickActivate *quick_activate;
...@@ -191,12 +191,8 @@ static void activate_plugin(PluginHost *host) ...@@ -191,12 +191,8 @@ static void activate_plugin(PluginHost *host)
IViewObjectEx *view_obj; IViewObjectEx *view_obj;
IDispatchEx *dispex; IDispatchEx *dispex;
IDispatch *disp; IDispatch *disp;
RECT rect;
HRESULT hres; HRESULT hres;
if(!host->plugin_unk)
return;
/* Note native calls QI on plugin for an undocumented IID and CLSID_HTMLDocument */ /* Note native calls QI on plugin for an undocumented IID and CLSID_HTMLDocument */
/* FIXME: call FreezeEvents(TRUE) */ /* FIXME: call FreezeEvents(TRUE) */
...@@ -281,6 +277,13 @@ static void activate_plugin(PluginHost *host) ...@@ -281,6 +277,13 @@ static void activate_plugin(PluginHost *host)
FIXME("Use IOleCommandTarget\n"); FIXME("Use IOleCommandTarget\n");
IOleCommandTarget_Release(cmdtrg); IOleCommandTarget_Release(cmdtrg);
} }
}
static void embed_plugin_object(PluginHost *host)
{
IOleObject *ole_obj;
RECT rect;
HRESULT hres;
hres = IUnknown_QueryInterface(host->plugin_unk, &IID_IOleObject, (void**)&ole_obj); hres = IUnknown_QueryInterface(host->plugin_unk, &IID_IOleObject, (void**)&ole_obj);
if(FAILED(hres)) { if(FAILED(hres)) {
...@@ -288,13 +291,11 @@ static void activate_plugin(PluginHost *host) ...@@ -288,13 +291,11 @@ static void activate_plugin(PluginHost *host)
return; return;
} }
if(ole_obj) { get_pos_rect(host, &rect);
get_pos_rect(host, &rect); hres = IOleObject_DoVerb(ole_obj, OLEIVERB_INPLACEACTIVATE, NULL, &host->IOleClientSite_iface, 0, host->hwnd, &rect);
hres = IOleObject_DoVerb(ole_obj, OLEIVERB_INPLACEACTIVATE, NULL, &host->IOleClientSite_iface, 0, host->hwnd, &rect); IOleObject_Release(ole_obj);
IOleObject_Release(ole_obj); if(FAILED(hres))
if(FAILED(hres)) WARN("DoVerb failed: %08x\n", hres);
WARN("DoVerb failed: %08x\n", hres);
}
if(host->ip_object) { if(host->ip_object) {
HWND hwnd; HWND hwnd;
...@@ -323,7 +324,7 @@ void update_plugin_window(PluginHost *host, HWND hwnd, const RECT *rect) ...@@ -323,7 +324,7 @@ void update_plugin_window(PluginHost *host, HWND hwnd, const RECT *rect)
if(!host->hwnd) { if(!host->hwnd) {
host->hwnd = hwnd; host->hwnd = hwnd;
activate_plugin(host); embed_plugin_object(host);
} }
if(rect_changed && host->ip_object) if(rect_changed && host->ip_object)
...@@ -2103,5 +2104,8 @@ HRESULT create_plugin_host(HTMLDocumentNode *doc, HTMLPluginContainer *container ...@@ -2103,5 +2104,8 @@ HRESULT create_plugin_host(HTMLDocumentNode *doc, HTMLPluginContainer *container
container->plugin_host = host; container->plugin_host = host;
host->element = container; host->element = container;
initialize_plugin_object(host);
return S_OK; return S_OK;
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment