Alexander Nicolaysen Sørnes : shdocvw: Update the address bar when URL changes.
Alexandre Julliard
julliard at winehq.org
Thu Jul 29 12:08:43 CDT 2010
Module: wine
Branch: master
Commit: 75909f215855059ae5ca47329593ff9fb3c0ecfe
URL: http://source.winehq.org/git/wine.git/?a=commit;h=75909f215855059ae5ca47329593ff9fb3c0ecfe
Author: Alexander Nicolaysen Sørnes <alex at thehandofagony.com>
Date: Tue Jul 27 14:23:14 2010 +0200
shdocvw: Update the address bar when URL changes.
---
dlls/shdocvw/iexplore.c | 20 +++++++++++++++-----
dlls/shdocvw/shdocvw.h | 2 ++
2 files changed, 17 insertions(+), 5 deletions(-)
diff --git a/dlls/shdocvw/iexplore.c b/dlls/shdocvw/iexplore.c
index e98b74c..b2359ca 100644
--- a/dlls/shdocvw/iexplore.c
+++ b/dlls/shdocvw/iexplore.c
@@ -179,7 +179,6 @@ static LRESULT iewnd_OnNotify(InternetExplorer *This, WPARAM wparam, LPARAM lpar
if(info->fChanged && info->iWhy == CBENF_RETURN && info->szText)
{
VARIANT vt;
- HWND hwndEdit = (HWND)SendMessageW(hdr->hwndFrom, CBEM_GETEDITCONTROL, 0, 0);
V_VT(&vt) = VT_BSTR;
V_BSTR(&vt) = SysAllocString(info->szText);
@@ -188,9 +187,6 @@ static LRESULT iewnd_OnNotify(InternetExplorer *This, WPARAM wparam, LPARAM lpar
SysFreeString(V_BSTR(&vt));
- /* Clear the address bar, as we don't change it when
- the user navigates to a new page */
- SendMessageW(hwndEdit, WM_SETTEXT, 0, 0);
return 0;
}
}
@@ -240,6 +236,18 @@ static LRESULT CALLBACK iewnd_OnCommand(InternetExplorer *This, HWND hwnd, UINT
return 0;
}
+static LRESULT CALLBACK update_addrbar(InternetExplorer *This, LPARAM lparam)
+{
+ HWND hwndRebar = GetDlgItem(This->frame_hwnd, IDC_BROWSE_REBAR);
+ HWND hwndAddress = GetDlgItem(hwndRebar, IDC_BROWSE_ADDRESSBAR);
+ HWND hwndEdit = (HWND)SendMessageW(hwndAddress, CBEM_GETEDITCONTROL, 0, 0);
+ LPCWSTR url = (LPCWSTR)lparam;
+
+ SendMessageW(hwndEdit, WM_SETTEXT, 0, (LPARAM)url);
+
+ return 0;
+}
+
static LRESULT CALLBACK
ie_window_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
{
@@ -259,6 +267,8 @@ ie_window_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
return iewnd_OnNotify(This, wparam, lparam);
case WM_DOCHOSTTASK:
return process_dochost_task(&This->doc_host, lparam);
+ case WM_UPDATEADDRBAR:
+ return update_addrbar(This, lparam);
}
return DefWindowProcW(hwnd, msg, wparam, lparam);
}
@@ -359,7 +369,7 @@ static HRESULT WINAPI DocHostContainer_SetStatusText(DocHost* This, LPCWSTR text
static void WINAPI DocHostContainer_SetURL(DocHost* This, LPCWSTR url)
{
-
+ SendMessageW(This->frame_hwnd, WM_UPDATEADDRBAR, 0, (LPARAM)url);
}
static const IDocHostContainerVtbl DocHostContainerVtbl = {
diff --git a/dlls/shdocvw/shdocvw.h b/dlls/shdocvw/shdocvw.h
index 2d7f03b..2bdf436 100644
--- a/dlls/shdocvw/shdocvw.h
+++ b/dlls/shdocvw/shdocvw.h
@@ -43,6 +43,8 @@
#include "resource.h"
+#define WM_UPDATEADDRBAR (WM_APP+1)
+
/**********************************************************************
* Shell Instance Objects
*/
More information about the wine-cvs
mailing list