Jacek Caban : shdocvw: Don't create IE default window in embedding mode.

Alexandre Julliard julliard at wine.codeweavers.com
Fri Apr 21 06:17:23 CDT 2006


Module: wine
Branch: refs/heads/master
Commit: 238afbb688045dce27f3226c417c5907b3e9c1a5
URL:    http://source.winehq.org/git/?p=wine.git;a=commit;h=238afbb688045dce27f3226c417c5907b3e9c1a5

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Fri Apr 21 12:14:57 2006 +0200

shdocvw: Don't create IE default window in embedding mode.

---

 dlls/shdocvw/iexplore.c |   37 +++++++++++++++++++++----------------
 1 files changed, 21 insertions(+), 16 deletions(-)

diff --git a/dlls/shdocvw/iexplore.c b/dlls/shdocvw/iexplore.c
index 2b3d7b0..91548fd 100644
--- a/dlls/shdocvw/iexplore.c
+++ b/dlls/shdocvw/iexplore.c
@@ -123,7 +123,6 @@ static void create_frame_hwnd(InternetEx
 static IWebBrowser2 *create_ie_window(LPCWSTR url)
 {
     IWebBrowser2 *wb = NULL;
-    MSG msg;
     VARIANT var_url;
 
     InternetExplorer_Create(NULL, &IID_IWebBrowser2, (void**)&wb);
@@ -140,13 +139,6 @@ static IWebBrowser2 *create_ie_window(LP
 
     SysFreeString(V_BSTR(&var_url));
 
-    /* run the message loop for this thread */
-    while (GetMessageW(&msg, 0, 0, 0))
-    {
-        TranslateMessage(&msg);
-        DispatchMessageW(&msg);
-    }
-
     return wb;
 }
 
@@ -184,8 +176,8 @@ HRESULT InternetExplorer_Create(IUnknown
  */
 DWORD WINAPI IEWinMain(LPSTR szCommandLine, int nShowWindow)
 {
-    LPWSTR url;
-    DWORD len;
+    IWebBrowser2 *wb = NULL;
+    MSG msg;
     HRESULT hres;
 
     FIXME("%s %d\n", debugstr_a(szCommandLine), nShowWindow);
@@ -198,15 +190,28 @@ DWORD WINAPI IEWinMain(LPSTR szCommandLi
         ExitProcess(1);
     }
 
-    /* FIXME: parse the command line properly, handle -Embedding */
+    if(strcmp(szCommandLine, "-Embedding")) {
+        LPWSTR url;
+        DWORD len;
 
-    len = MultiByteToWideChar(CP_ACP, 0, szCommandLine, -1, NULL, 0);
-    url = HeapAlloc(GetProcessHeap(),0,len*sizeof(WCHAR));
-    MultiByteToWideChar(CP_ACP, 0, szCommandLine, -1, url, len);
+        len = MultiByteToWideChar(CP_ACP, 0, szCommandLine, -1, NULL, 0);
+        url = HeapAlloc(GetProcessHeap(),0,len*sizeof(WCHAR));
+        MultiByteToWideChar(CP_ACP, 0, szCommandLine, -1, url, len);
 
-    create_ie_window(url);
+        wb = create_ie_window(url);
+
+        HeapFree(GetProcessHeap(), 0, url);
+    }
+
+    /* run the message loop for this thread */
+    while (GetMessageW(&msg, 0, 0, 0))
+    {
+        TranslateMessage(&msg);
+        DispatchMessageW(&msg);
+    }
 
-    HeapFree(GetProcessHeap(), 0, url);
+    if(wb)
+        IWebBrowser2_Release(wb);
 
     register_class_object(FALSE);
 




More information about the wine-cvs mailing list