Author: dquintana
Date: Thu Jun 19 23:23:04 2014
New Revision: 63621
URL:
http://svn.reactos.org/svn/reactos?rev=63621&view=rev
Log:
[BROWSEUI]
* Process ParseNow on the CBEN_ENDEDIT notification.
* Call SHAutoComplete to ask the edit control to have autocomplete functionality. I need
to figure out the flag or whatever is needed to make it show "Search
'string'" when entering something that's not a valid path.
Modified:
branches/shell-experiments/dll/win32/browseui/addressband.cpp
branches/shell-experiments/dll/win32/browseui/addresseditbox.cpp
Modified: branches/shell-experiments/dll/win32/browseui/addressband.cpp
URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/bro…
==============================================================================
--- branches/shell-experiments/dll/win32/browseui/addressband.cpp [iso-8859-1] (original)
+++ branches/shell-experiments/dll/win32/browseui/addressband.cpp [iso-8859-1] Thu Jun 19
23:23:04 2014
@@ -347,6 +347,8 @@
CComPtr<IWinEventHandler> winEventHandler;
HRESULT hResult;
+ *theResult = 0;
+
switch (uMsg)
{
case WM_WININICHANGE:
@@ -544,7 +546,6 @@
{
if (notifyHeader->hwndFrom == fGoButton)
{
- fAddressEditBox->ParseNow(0);
fAddressEditBox->Execute(0);
}
return 0;
Modified: branches/shell-experiments/dll/win32/browseui/addresseditbox.cpp
URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/bro…
==============================================================================
--- branches/shell-experiments/dll/win32/browseui/addresseditbox.cpp [iso-8859-1]
(original)
+++ branches/shell-experiments/dll/win32/browseui/addresseditbox.cpp [iso-8859-1] Thu Jun
19 23:23:04 2014
@@ -74,6 +74,8 @@
fEditWindow.SubclassWindow(editControl);
fSite = param18;
+ SHAutoComplete(fEditWindow.m_hWnd, SHACF_FILESYSTEM | SHACF_URLALL | SHACF_USETAB);
+
// take advice to watch events
HRESULT hResult = IUnknown_QueryService(param18, SID_SShellBrowser,
IID_PPV_ARG(IBrowserService, &browserService));
if (SUCCEEDED(hResult))
@@ -98,8 +100,12 @@
CComPtr<IShellBrowser> pisb;
hr = IUnknown_QueryService(fSite, SID_SShellBrowser, IID_PPV_ARG(IShellBrowser,
&pisb));
-
- IUnknown_GetWindow(pisb, &topLevelWindow);
+ if (FAILED_UNEXPECTEDLY(hr))
+ return hr;
+
+ hr = IUnknown_GetWindow(pisb, &topLevelWindow);
+ if (FAILED_UNEXPECTEDLY(hr))
+ return hr;
LPWSTR input;
int inputLength = GetWindowTextLength(fCombobox.m_hWnd) + 2;
@@ -118,12 +124,19 @@
{
addressLength += 2;
address = new WCHAR[addressLength];
- ExpandEnvironmentStrings(input, address, 0);
+ if (!ExpandEnvironmentStrings(input, address, addressLength))
+ {
+ delete[] address;
+ address = input;
+ }
}
CComPtr<IShellFolder> psfDesktop;
hr = SHGetDesktopFolder(&psfDesktop);
- hr = psfDesktop->ParseDisplayName(topLevelWindow, NULL, address, &eaten,
&pidlLastParsed, &attributes);
+ if (SUCCEEDED(hr))
+ {
+ hr = psfDesktop->ParseDisplayName(topLevelWindow, NULL, address, &eaten,
&pidlLastParsed, &attributes);
+ }
if (address != input)
delete [] address;
@@ -171,8 +184,21 @@
HRESULT STDMETHODCALLTYPE CAddressEditBox::OnWinEvent(
HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT *theResult)
{
- // handle fill of listbox here
- return E_NOTIMPL;
+ LPNMHDR hdr;
+
+ *theResult = 0;
+
+ switch (uMsg)
+ {
+ case WM_NOTIFY:
+ hdr = (LPNMHDR) lParam;
+ if (hdr->code == CBEN_ENDEDIT)
+ {
+ ParseNow(0);
+ }
+ break;
+ }
+ return S_OK;
}
HRESULT STDMETHODCALLTYPE CAddressEditBox::IsWindowOwner(HWND hWnd)