Author: dquintana
Date: Wed Jul 9 23:37:02 2014
New Revision: 63704
URL:
http://svn.reactos.org/svn/reactos?rev=63704&view=rev
Log:
[RSHELL]
* Filter out the Programs item from the top list.
Modified:
branches/shell-experiments/base/shell/rshell/CMenuToolbars.cpp
branches/shell-experiments/base/shell/rshell/CStartMenu.cpp
Modified: branches/shell-experiments/base/shell/rshell/CMenuToolbars.cpp
URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/rs…
==============================================================================
--- branches/shell-experiments/base/shell/rshell/CMenuToolbars.cpp [iso-8859-1]
(original)
+++ branches/shell-experiments/base/shell/rshell/CMenuToolbars.cpp [iso-8859-1] Wed Jul 9
23:37:02 2014
@@ -1285,29 +1285,37 @@
INT index = 0;
INT indexOpen = 0;
- STRRET sr = { STRRET_CSTR, { 0 } };
-
- hr = m_shellFolder->GetDisplayNameOf(item, SIGDN_NORMALDISPLAY, &sr);
- if (FAILED_UNEXPECTEDLY(hr))
- return hr;
-
- StrRetToStr(&sr, NULL, &MenuString);
-
- index = SHMapPIDLToSystemImageListIndex(m_shellFolder, item, &indexOpen);
-
- LPCITEMIDLIST itemc = item;
-
- SFGAOF attrs = SFGAO_FOLDER;
- hr = m_shellFolder->GetAttributesOf(1, &itemc, &attrs);
-
- DWORD_PTR dwData = reinterpret_cast<DWORD_PTR>(ILClone(item));
-
- // Fetch next item already, so we know if the current one is the last
- hr = eidl->Next(1, &item, NULL);
-
- AddButton(++i, MenuString, attrs & SFGAO_FOLDER, index, dwData, hr != S_OK);
-
- CoTaskMemFree(MenuString);
+ if (m_menuBand->_CallCBWithItemPidl(item, 0x10000000, 0, 0) == S_OK)
+ {
+ STRRET sr = { STRRET_CSTR, { 0 } };
+
+ hr = m_shellFolder->GetDisplayNameOf(item, SIGDN_NORMALDISPLAY, &sr);
+ if (FAILED_UNEXPECTEDLY(hr))
+ return hr;
+
+ StrRetToStr(&sr, NULL, &MenuString);
+
+ index = SHMapPIDLToSystemImageListIndex(m_shellFolder, item,
&indexOpen);
+
+ LPCITEMIDLIST itemc = item;
+
+ SFGAOF attrs = SFGAO_FOLDER;
+ hr = m_shellFolder->GetAttributesOf(1, &itemc, &attrs);
+
+ DWORD_PTR dwData = reinterpret_cast<DWORD_PTR>(ILClone(item));
+
+ // Fetch next item already, so we know if the current one is the last
+ hr = eidl->Next(1, &item, NULL);
+
+ AddButton(++i, MenuString, attrs & SFGAO_FOLDER, index, dwData, hr !=
S_OK);
+
+ CoTaskMemFree(MenuString);
+ }
+ else
+ {
+ // Fetch next item here also
+ hr = eidl->Next(1, &item, NULL);
+ }
}
ILFree(item);
Modified: branches/shell-experiments/base/shell/rshell/CStartMenu.cpp
URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/rs…
==============================================================================
--- branches/shell-experiments/base/shell/rshell/CStartMenu.cpp [iso-8859-1] (original)
+++ branches/shell-experiments/base/shell/rshell/CStartMenu.cpp [iso-8859-1] Wed Jul 9
23:37:02 2014
@@ -65,7 +65,9 @@
CComPtr<IBandSite> m_pBandSite;
CComPtr<IDeskBar> m_pDeskBar;
CComPtr<ITrayPriv> m_pTrayPriv;
- CComPtr<IShellFolder> m_programsFolder;
+ CComPtr<IShellFolder> m_psfPrograms;
+
+ LPITEMIDLIST m_pidlPrograms;
HRESULT OnInitMenu()
{
@@ -161,9 +163,9 @@
{
IShellFolder *psfStartMenu;
- if (csidl == CSIDL_PROGRAMS && m_programsFolder)
+ if (csidl == CSIDL_PROGRAMS && m_psfPrograms)
{
- psfStartMenu = m_programsFolder;
+ psfStartMenu = m_psfPrograms;
}
else
{
@@ -251,9 +253,10 @@
m_pDeskBar.Release();
}
- HRESULT _SetProgramsFolder(IShellFolder * programs)
- {
- m_programsFolder = programs;
+ HRESULT _SetProgramsFolder(IShellFolder * psf, LPITEMIDLIST pidl)
+ {
+ m_psfPrograms = psf;
+ m_pidlPrograms = pidl;
return S_OK;
}
@@ -276,6 +279,10 @@
case SMC_SFEXEC:
m_pTrayPriv->Execute(psmd->psf, psmd->pidlItem);
break;
+ case 0x10000000: // _FilterPIDL from CMenuSFToolbar
+ if (psmd->psf->CompareIDs(0, psmd->pidlItem, m_pidlPrograms) == 0)
+ return S_FALSE;
+ return S_OK;
}
return S_FALSE;
@@ -312,9 +319,9 @@
if (FAILED(SHGetSpecialFolderLocation(NULL, CSIDL_COMMON_STARTMENU,
&pidlCommonStartMenu)))
{
- BindToDesktop(pidlUserStartMenu, ppsfStartMenu);
+ hr = BindToDesktop(pidlUserStartMenu, ppsfStartMenu);
ILFree(pidlUserStartMenu);
- return S_OK;
+ return hr;
}
CComPtr<IShellFolder> psfUserStartMenu;
@@ -337,10 +344,10 @@
hr = CoCreateInstance(CLSID_MergedFolder, NULL, CLSCTX_INPROC_SERVER,
IID_PPV_ARG(IAugmentedShellFolder, &pasf));
if (FAILED_UNEXPECTEDLY(hr))
{
- BindToDesktop(pidlUserStartMenu, ppsfStartMenu);
+ hr = BindToDesktop(pidlUserStartMenu, ppsfStartMenu);
ILFree(pidlCommonStartMenu);
ILFree(pidlUserStartMenu);
- return S_OK;
+ return hr;
}
hr = pasf->AddNameSpace(NULL, psfUserStartMenu, pidlUserStartMenu, 0xFF00);
@@ -410,7 +417,7 @@
if (FAILED_UNEXPECTEDLY(hr))
return hr;
- hr = pCallback->_SetProgramsFolder(psfPrograms);
+ hr = pCallback->_SetProgramsFolder(psfPrograms, pidlPrograms);
if (FAILED_UNEXPECTEDLY(hr))
return hr;