[BROWSEUI]
authorDavid Quintana <gigaherz@gmail.com>
Mon, 19 May 2014 16:08:30 +0000 (16:08 +0000)
committerDavid Quintana <gigaherz@gmail.com>
Mon, 19 May 2014 16:08:30 +0000 (16:08 +0000)
* Implement ParseNow to allow navigating to the current address in the editbox.

[SHELL32]
* Set the focus to the listview if the browser is requesting it.

CORE-7330

svn path=/branches/shell-experiments/; revision=63371

dll/win32/browseui/addresseditbox.cpp
dll/win32/browseui/addresseditbox.h
dll/win32/browseui/internettoolbar.cpp
dll/win32/shell32/shlview.cpp

index 2a0cfa2..2a3448a 100644 (file)
@@ -41,7 +41,8 @@ TODO:
 
 CAddressEditBox::CAddressEditBox() :
     fCombobox(NULL, this, 1),
-    fEditWindow(NULL, this, 1)
+    fEditWindow(NULL, this, 1),
+    fSite(NULL)
 {
 }
 
@@ -69,6 +70,7 @@ HRESULT STDMETHODCALLTYPE CAddressEditBox::Init(HWND comboboxEx, HWND editContro
 {
     fCombobox.SubclassWindow(comboboxEx);
     fEditWindow.SubclassWindow(editControl);
+    fSite = param18;
     return S_OK;
 }
 
@@ -82,7 +84,28 @@ HRESULT STDMETHODCALLTYPE CAddressEditBox::SetCurrentDir(long paramC)
 
 HRESULT STDMETHODCALLTYPE CAddressEditBox::ParseNow(long paramC)
 {
-    return E_NOTIMPL;
+    WCHAR address[4096];
+    ULONG eaten;
+    LPITEMIDLIST pidl;
+    ULONG attributes;
+    HRESULT hr;
+    HWND topLevelWindow;
+
+    CComPtr<IShellBrowser> pisb;
+    hr = IUnknown_QueryService(fSite, SID_SShellBrowser, IID_PPV_ARG(IShellBrowser, &pisb));
+
+    IUnknown_GetWindow(pisb, &topLevelWindow);
+
+    GetWindowText(fCombobox.m_hWnd, address, 4095);
+
+    CComPtr<IShellFolder> psfDesktop;
+    hr = SHGetDesktopFolder(&psfDesktop);
+    hr = psfDesktop->ParseDisplayName(topLevelWindow, NULL, address, &eaten, &pidl, &attributes);
+    if (SUCCEEDED(hr))
+    {
+        hr = pisb->BrowseObject(pidl, 0);
+    }
+    return hr;
 }
 
 HRESULT STDMETHODCALLTYPE CAddressEditBox::Execute(long paramC)
index eeff524..4e6b417 100644 (file)
@@ -35,6 +35,7 @@ class CAddressEditBox :
 private:
     CContainedWindow                        fCombobox;
     CContainedWindow                        fEditWindow;
+    CComPtr<IUnknown> fSite;
 public:
     CAddressEditBox();
     ~CAddressEditBox();
index 0a9604e..eba24bd 100644 (file)
@@ -860,6 +860,8 @@ HRESULT STDMETHODCALLTYPE CInternetToolbar::InitNew()
     hResult = menuOleWindow->GetWindow(&fMenuBandWindow);
     fMenuBar.Attach(menuBar.Detach());                  // transfer the ref count
 
+    // FIXME: The ros Rebar does not properly support fixed-size items such as the brandband,
+    // and it will put them in their own row, sized to take up the whole row.
 #if 0
     /* Create and attach the brand/logo to the rebar */
     hResult = CreateBrandBand(&logoBar);
index aa5de10..f1b4b4a 100644 (file)
@@ -1419,6 +1419,8 @@ void CDefView::DoActivate(UINT uState)
                 {
                     MergeFileMenu(mii.hSubMenu);
                 }
+
+                ::SetFocus(m_hWndList);
             }
 
             TRACE("-- before fnSetMenuSB\n");