[PATCH] ieframe: When activating UI also activate the embedded document.

Dmitry Timoshkov dmitry at baikal.ru
Fri Aug 14 02:04:03 CDT 2020


Signed-off-by: Dmitry Timoshkov <dmitry at baikal.ru>
---
 dlls/ieframe/dochost.c   | 26 ++++++++++++++++++++++++++
 dlls/ieframe/ieframe.h   |  1 +
 dlls/ieframe/oleobject.c |  2 ++
 3 files changed, 29 insertions(+)

diff --git a/dlls/ieframe/dochost.c b/dlls/ieframe/dochost.c
index 46d5cc5dd1..042417b5b1 100644
--- a/dlls/ieframe/dochost.c
+++ b/dlls/ieframe/dochost.c
@@ -598,6 +598,32 @@ HRESULT refresh_document(DocHost *This, const VARIANT *level)
     return S_OK;
 }
 
+void activate_document(DocHost *This)
+{
+    IOleObject *oleobj;
+    IHlinkTarget *hlink;
+    HRESULT hres;
+
+    if(!This->document) return;
+
+    hres = IUnknown_QueryInterface(This->document, &IID_IHlinkTarget, (void**)&hlink);
+    if(SUCCEEDED(hres)) {
+        IHlinkTarget_Navigate(hlink, 0, NULL);
+        IHlinkTarget_Release(hlink);
+    }
+
+    hres = IUnknown_QueryInterface(This->document, &IID_IOleObject, (void**)&oleobj);
+    if(SUCCEEDED(hres)) {
+        IOleObject_DoVerb(oleobj, OLEIVERB_SHOW, NULL, NULL, -1, 0, NULL);
+        IOleObject_Release(oleobj);
+    }
+
+    refresh_document(This, NULL);
+
+    if(This->view)
+        IOleDocumentView_UIActivate(This->view, TRUE);
+}
+
 void release_dochost_client(DocHost *This)
 {
     if(This->hwnd) {
diff --git a/dlls/ieframe/ieframe.h b/dlls/ieframe/ieframe.h
index 24d490c272..a35507e6fb 100644
--- a/dlls/ieframe/ieframe.h
+++ b/dlls/ieframe/ieframe.h
@@ -283,6 +283,7 @@ HRESULT set_dochost_url(DocHost*,const WCHAR*) DECLSPEC_HIDDEN;
 void handle_navigation_error(DocHost*,HRESULT,BSTR,IHTMLWindow2*) DECLSPEC_HIDDEN;
 HRESULT dochost_object_available(DocHost*,IUnknown*) DECLSPEC_HIDDEN;
 void set_doc_state(DocHost*,READYSTATE) DECLSPEC_HIDDEN;
+void activate_document(DocHost*) DECLSPEC_HIDDEN;
 void deactivate_document(DocHost*) DECLSPEC_HIDDEN;
 void create_doc_view_hwnd(DocHost*) DECLSPEC_HIDDEN;
 void on_commandstate_change(DocHost*,LONG,BOOL) DECLSPEC_HIDDEN;
diff --git a/dlls/ieframe/oleobject.c b/dlls/ieframe/oleobject.c
index a2f87dda2f..be0e6ec5bf 100644
--- a/dlls/ieframe/oleobject.c
+++ b/dlls/ieframe/oleobject.c
@@ -230,6 +230,8 @@ static HRESULT activate_ui(WebBrowser *This, IOleClientSite *active_site)
     SetFocus(This->shell_embedding_hwnd);
     notify_on_focus(This, TRUE);
 
+    activate_document(&This->doc_host);
+
     This->ui_activated = TRUE;
 
     return S_OK;
-- 
2.26.2




More information about the wine-devel mailing list