Alexander Nicolaysen Sørnes : shdocvw: Make the Open URL dialog open URLs.

Alexandre Julliard julliard at winehq.org
Fri Jul 23 10:05:49 CDT 2010


Module: wine
Branch: master
Commit: e4620d8e3a9e3223fac0bff2d7efa6cc442bcbda
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=e4620d8e3a9e3223fac0bff2d7efa6cc442bcbda

Author: Alexander Nicolaysen Sørnes <alex at thehandofagony.com>
Date:   Mon Jun 21 17:47:55 2010 +0200

shdocvw: Make the Open URL dialog open URLs.

---

 dlls/shdocvw/iexplore.c |   32 +++++++++++++++++++++++++++++++-
 1 files changed, 31 insertions(+), 1 deletions(-)

diff --git a/dlls/shdocvw/iexplore.c b/dlls/shdocvw/iexplore.c
index 04b386c..fa643fe 100644
--- a/dlls/shdocvw/iexplore.c
+++ b/dlls/shdocvw/iexplore.c
@@ -49,15 +49,45 @@ static const WCHAR wszWineInternetExplorer[] =
 
 static INT_PTR CALLBACK ie_dialog_open_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
 {
+    static InternetExplorer* This;
+
     switch(msg)
     {
         case WM_INITDIALOG:
+            This = (InternetExplorer*)lparam;
+            EnableWindow(GetDlgItem(hwnd, IDOK), FALSE);
             return TRUE;
 
         case WM_COMMAND:
             switch(LOWORD(wparam))
             {
+                case IDC_BROWSE_OPEN_URL:
+                {
+                    HWND hwndurl = GetDlgItem(hwnd, IDC_BROWSE_OPEN_URL);
+                    int len = GetWindowTextLengthW(hwndurl);
+
+                    EnableWindow(GetDlgItem(hwnd, IDOK), len ? TRUE : FALSE);
+                    break;
+                }
                 case IDOK:
+                {
+                    HWND hwndurl = GetDlgItem(hwnd, IDC_BROWSE_OPEN_URL);
+                    int len = GetWindowTextLengthW(hwndurl);
+
+                    if(len)
+                    {
+                        VARIANT url;
+
+                        V_VT(&url) = VT_BSTR;
+                        V_BSTR(&url) = SysAllocStringLen(NULL, len);
+
+                        GetWindowTextW(hwndurl, V_BSTR(&url), len);
+                        IWebBrowser2_Navigate2(WEBBROWSER2(This), &url, NULL, NULL, NULL, NULL);
+
+                        SysFreeString(V_BSTR(&url));
+                    }
+                }
+                /* fall through */
                 case IDCANCEL:
                     EndDialog(hwnd, wparam);
                     return TRUE;
@@ -105,7 +135,7 @@ static LRESULT CALLBACK iewnd_OnCommand(InternetExplorer *This, HWND hwnd, UINT
     switch(LOWORD(wparam))
     {
         case ID_BROWSE_OPEN:
-            DialogBoxW(shdocvw_hinstance, MAKEINTRESOURCEW(IDD_BROWSE_OPEN), hwnd, ie_dialog_open_proc);
+            DialogBoxParamW(shdocvw_hinstance, MAKEINTRESOURCEW(IDD_BROWSE_OPEN), hwnd, ie_dialog_open_proc, (LPARAM)This);
             break;
 
         case ID_BROWSE_PRINT:




More information about the wine-cvs mailing list