Alexander Nicolaysen Sørnes : shdocvw: Add Open URL dialog to IE.

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


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

Author: Alexander Nicolaysen Sørnes <alex at thehandofagony.com>
Date:   Wed Jul 21 16:38:45 2010 +0200

shdocvw: Add Open URL dialog to IE.

---

 dlls/shdocvw/En.rc      |   12 ++++++++++++
 dlls/shdocvw/iexplore.c |   23 +++++++++++++++++++++++
 dlls/shdocvw/resource.h |    3 +++
 3 files changed, 38 insertions(+), 0 deletions(-)

diff --git a/dlls/shdocvw/En.rc b/dlls/shdocvw/En.rc
index 154d080..749c849 100644
--- a/dlls/shdocvw/En.rc
+++ b/dlls/shdocvw/En.rc
@@ -20,6 +20,18 @@
 
 LANGUAGE LANG_ENGLISH, SUBLANG_DEFAULT
 
+IDD_BROWSE_OPEN DIALOG 10, 10, 200, 70
+STYLE DS_MODALFRAME | WS_CAPTION
+CAPTION "Open URL"
+FONT 8, "MS Shell Dlg"
+{
+    LTEXT "Specify the URL you wish to open in Internet Explorer",-1,25, 5, 150,15
+    LTEXT "Open:", -1, 2, 32, 20, 15
+    EDITTEXT IDC_BROWSE_OPEN_URL, 25, 30, 160, 13
+    DEFPUSHBUTTON "&OK", IDOK, 25, 50, 50, 15
+    PUSHBUTTON "&Cancel", IDCANCEL, 85, 50, 50, 15
+}
+
 IDR_BROWSE_MAIN_MENU MENU
 {
     POPUP "&File"
diff --git a/dlls/shdocvw/iexplore.c b/dlls/shdocvw/iexplore.c
index 2ca756e..04b386c 100644
--- a/dlls/shdocvw/iexplore.c
+++ b/dlls/shdocvw/iexplore.c
@@ -47,6 +47,25 @@ static const WCHAR szIEWinFrame[] = { 'I','E','F','r','a','m','e',0 };
 static const WCHAR wszWineInternetExplorer[] =
         {'W','i','n','e',' ','I','n','t','e','r','n','e','t',' ','E','x','p','l','o','r','e','r',0};
 
+static INT_PTR CALLBACK ie_dialog_open_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
+{
+    switch(msg)
+    {
+        case WM_INITDIALOG:
+            return TRUE;
+
+        case WM_COMMAND:
+            switch(LOWORD(wparam))
+            {
+                case IDOK:
+                case IDCANCEL:
+                    EndDialog(hwnd, wparam);
+                    return TRUE;
+            }
+    }
+    return FALSE;
+}
+
 static void ie_dialog_about(HWND hwnd)
 {
     HICON icon = LoadImageW(GetModuleHandleW(0), MAKEINTRESOURCEW(IDI_APPICON), IMAGE_ICON, 48, 48, LR_SHARED);
@@ -85,6 +104,10 @@ 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);
+            break;
+
         case ID_BROWSE_PRINT:
             if(This->doc_host.document)
             {
diff --git a/dlls/shdocvw/resource.h b/dlls/shdocvw/resource.h
index 3a1f0e7..31a7005 100644
--- a/dlls/shdocvw/resource.h
+++ b/dlls/shdocvw/resource.h
@@ -19,8 +19,11 @@
  */
 
 #include <windef.h>
+#include <winuser.h>
 
 #define IDR_BROWSE_MAIN_MENU           1000
+#define IDD_BROWSE_OPEN                1001
+#define IDC_BROWSE_OPEN_URL            1002
 
 #define ID_BROWSE_NEW_WINDOW           275
 #define ID_BROWSE_OPEN                 256




More information about the wine-cvs mailing list