Author: dquintana
Date: Wed Jul 2 14:48:21 2014
New Revision: 63683
URL:
http://svn.reactos.org/svn/reactos?rev=63683&view=rev
Log:
[RSHELL]
* Handle SMSET_BOTTOM on SetShellFolder so the shell items show below the static menu.
* Downgrade some DbgPrints to TRACEs (reduces log spam).
* Add some extra debugging messages to CMergedFolder.
* Export the CMergedFolder constructor so it can be used from browseui.
[BROWSEUI]
* Use merged folders for the Favorites menu.
Modified:
branches/shell-experiments/base/shell/rshell/CMenuBand.cpp
branches/shell-experiments/base/shell/rshell/CMenuBand.h
branches/shell-experiments/base/shell/rshell/CMenuFocusManager.cpp
branches/shell-experiments/base/shell/rshell/CMergedFolder.cpp
branches/shell-experiments/base/shell/rshell/CMergedFolder.h
branches/shell-experiments/base/shell/rshell/rshell.spec
branches/shell-experiments/dll/win32/browseui/internettoolbar.cpp
branches/shell-experiments/dll/win32/shlwapi/CMakeLists.txt
Modified: branches/shell-experiments/base/shell/rshell/CMenuBand.cpp
URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/rs…
==============================================================================
--- branches/shell-experiments/base/shell/rshell/CMenuBand.cpp [iso-8859-1] (original)
+++ branches/shell-experiments/base/shell/rshell/CMenuBand.cpp [iso-8859-1] Wed Jul 2
14:48:21 2014
@@ -75,7 +75,8 @@
m_hotItem(-1),
m_popupBar(NULL),
m_popupItem(-1),
- m_Show(FALSE)
+ m_Show(FALSE),
+ m_shellBottom(FALSE)
{
m_focusManager = CMenuFocusManager::AcquireManager();
}
@@ -292,21 +293,43 @@
int syStatic = maxStatic.cy;
int syShlFld = sy - syStatic;
- if (m_SFToolbar)
- {
- m_SFToolbar->SetPosSize(
- prc->left,
- prc->top,
- prc->right - prc->left,
- syShlFld);
- }
- if (m_staticToolbar)
- {
- m_staticToolbar->SetPosSize(
- prc->left,
- prc->top + syShlFld,
- prc->right - prc->left,
- syStatic);
+ if (m_shellBottom)
+ {
+ if (m_SFToolbar)
+ {
+ m_SFToolbar->SetPosSize(
+ prc->left,
+ prc->top + syStatic,
+ prc->right - prc->left,
+ syShlFld);
+ }
+ if (m_staticToolbar)
+ {
+ m_staticToolbar->SetPosSize(
+ prc->left,
+ prc->top,
+ prc->right - prc->left,
+ syStatic);
+ }
+ }
+ else // shell menu on top
+ {
+ if (m_SFToolbar)
+ {
+ m_SFToolbar->SetPosSize(
+ prc->left,
+ prc->top,
+ prc->right - prc->left,
+ syShlFld);
+ }
+ if (m_staticToolbar)
+ {
+ m_staticToolbar->SetPosSize(
+ prc->left,
+ prc->top + syShlFld,
+ prc->right - prc->left,
+ syStatic);
+ }
}
return S_OK;
@@ -637,6 +660,8 @@
if (FAILED_UNEXPECTEDLY(hr))
return hr;
+ m_shellBottom = (dwFlags & SMSET_BOTTOM) != 0;
+
if (m_site)
{
HWND hwndParent;
Modified: branches/shell-experiments/base/shell/rshell/CMenuBand.h
URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/rs…
==============================================================================
--- branches/shell-experiments/base/shell/rshell/CMenuBand.h [iso-8859-1] (original)
+++ branches/shell-experiments/base/shell/rshell/CMenuBand.h [iso-8859-1] Wed Jul 2
14:48:21 2014
@@ -66,6 +66,7 @@
INT m_popupItem;
BOOL m_Show;
+ BOOL m_shellBottom;
public:
CMenuBand();
Modified: branches/shell-experiments/base/shell/rshell/CMenuFocusManager.cpp
URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/rs…
==============================================================================
--- branches/shell-experiments/base/shell/rshell/CMenuFocusManager.cpp [iso-8859-1]
(original)
+++ branches/shell-experiments/base/shell/rshell/CMenuFocusManager.cpp [iso-8859-1] Wed
Jul 2 14:48:21 2014
@@ -315,7 +315,7 @@
StackEntry * entry = NULL;
if (IsTrackedWindow(child, &entry) == S_OK)
{
- DbgPrint("MouseMove %d\n", m_isLButtonDown);
+ TRACE("MouseMove %d\n", m_isLButtonDown);
}
BOOL isTracking = FALSE;
@@ -392,7 +392,7 @@
if (IsTrackedWindow(child, &entry) != S_OK)
return TRUE;
- DbgPrint("MouseDown %d\n", m_isLButtonDown);
+ TRACE("MouseDown %d\n", m_isLButtonDown);
BOOL isTracking = FALSE;
if (entry)
@@ -403,7 +403,7 @@
if (iHitTestResult >= 0)
{
- DbgPrint("MouseDown send %d\n", iHitTestResult);
+ TRACE("MouseDown send %d\n", iHitTestResult);
entry->mb->_MenuBarMouseDown(child, iHitTestResult);
}
}
@@ -414,7 +414,7 @@
m_movedSinceDown = FALSE;
m_windowAtDown = child;
- DbgPrint("MouseDown end %d\n", m_isLButtonDown);
+ TRACE("MouseDown end %d\n", m_isLButtonDown);
return TRUE;
}
@@ -442,7 +442,7 @@
if (IsTrackedWindow(child, &entry) != S_OK)
return TRUE;
- DbgPrint("MouseUp %d\n", m_isLButtonDown);
+ TRACE("MouseUp %d\n", m_isLButtonDown);
BOOL isTracking = FALSE;
if (entry)
@@ -453,7 +453,7 @@
if (iHitTestResult >= 0)
{
- DbgPrint("MouseUp send %d\n", iHitTestResult);
+ TRACE("MouseUp send %d\n", iHitTestResult);
entry->mb->_MenuBarMouseUp(child, iHitTestResult);
}
}
Modified: branches/shell-experiments/base/shell/rshell/CMergedFolder.cpp
URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/rs…
==============================================================================
--- branches/shell-experiments/base/shell/rshell/CMergedFolder.cpp [iso-8859-1]
(original)
+++ branches/shell-experiments/base/shell/rshell/CMergedFolder.cpp [iso-8859-1] Wed Jul 2
14:48:21 2014
@@ -356,6 +356,18 @@
return hr;
}
+CMergedFolder::CMergedFolder() :
+ m_UserLocal(NULL),
+ m_AllUSers(NULL),
+ m_EnumSource(NULL),
+ m_shellPidl(NULL)
+{
+}
+
+CMergedFolder::~CMergedFolder()
+{
+}
+
HRESULT CMergedFolder::_SetSources(IShellFolder* userLocal, IShellFolder* allUsers)
{
m_UserLocal = userLocal;
@@ -382,6 +394,7 @@
SHCONTF grfFlags,
IEnumIDList **ppenumIDList)
{
+ DbgPrint("EnumObjects\n");
HRESULT hr = m_EnumSource->QueryInterface(IID_PPV_ARG(IEnumIDList,
ppenumIDList));
if (FAILED_UNEXPECTEDLY(hr))
return hr;
@@ -397,12 +410,14 @@
LocalPidlInfo info;
HRESULT hr;
+ DbgPrint("BindToObject\n");
+
hr = m_EnumSource->FindPidlInList(pidl, &info);
if (FAILED_UNEXPECTEDLY(hr))
return hr;
if (!info.shared)
- return info.parent->BindToObject(pidl, pbcReserved, riid, ppvOut);
+ return info.parent->BindToObject(info.pidl, pbcReserved, riid, ppvOut);
if (riid != IID_IShellFolder)
return E_FAIL;
@@ -410,11 +425,11 @@
CComPtr<IShellFolder> fld1;
CComPtr<IShellFolder> fld2;
- hr = m_UserLocal->BindToObject(pidl, pbcReserved, IID_PPV_ARG(IShellFolder,
&fld1));
- if (FAILED_UNEXPECTEDLY(hr))
- return hr;
-
- hr = m_AllUSers->BindToObject(pidl, pbcReserved, IID_PPV_ARG(IShellFolder,
&fld2));
+ hr = m_UserLocal->BindToObject(info.pidl, pbcReserved, IID_PPV_ARG(IShellFolder,
&fld1));
+ if (FAILED_UNEXPECTEDLY(hr))
+ return hr;
+
+ hr = m_AllUSers->BindToObject(info.pidl, pbcReserved, IID_PPV_ARG(IShellFolder,
&fld2));
if (FAILED_UNEXPECTEDLY(hr))
return hr;
@@ -436,6 +451,7 @@
LPCITEMIDLIST pidl1,
LPCITEMIDLIST pidl2)
{
+ DbgPrint("CompareIDs\n");
return m_UserLocal->CompareIDs(lParam, pidl1, pidl2);
}
@@ -456,6 +472,8 @@
LocalPidlInfo info;
HRESULT hr;
+ DbgPrint("GetAttributesOf\n");
+
for (int i = 0; i < (int)cidl; i++)
{
LPCITEMIDLIST pidl = apidl[i];
@@ -463,6 +481,8 @@
hr = m_EnumSource->FindPidlInList(pidl, &info);
if (FAILED_UNEXPECTEDLY(hr))
return hr;
+
+ pidl = info.pidl;
SFGAOF * pinOut1 = rgfInOut ? rgfInOut + i : NULL;
@@ -486,6 +506,8 @@
LocalPidlInfo info;
HRESULT hr;
+ DbgPrint("GetUIObjectOf\n");
+
for (int i = 0; i < (int)cidl; i++)
{
LPCITEMIDLIST pidl = apidl[i];
@@ -495,6 +517,8 @@
hr = m_EnumSource->FindPidlInList(pidl, &info);
if (FAILED_UNEXPECTEDLY(hr))
return hr;
+
+ pidl = info.pidl;
TRACE("FindPidlInList succeeded with parent %p and pidl { db=%d }\n",
info.parent, info.pidl->mkid.cb);
@@ -518,11 +542,13 @@
LocalPidlInfo info;
HRESULT hr;
+ DbgPrint("GetDisplayNameOf\n");
+
hr = m_EnumSource->FindPidlInList(pidl, &info);
if (FAILED_UNEXPECTEDLY(hr))
return hr;
- hr = info.parent->GetDisplayNameOf(pidl, uFlags, lpName);
+ hr = info.parent->GetDisplayNameOf(info.pidl, uFlags, lpName);
if (FAILED_UNEXPECTEDLY(hr))
return hr;
Modified: branches/shell-experiments/base/shell/rshell/CMergedFolder.h
URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/rs…
==============================================================================
--- branches/shell-experiments/base/shell/rshell/CMergedFolder.h [iso-8859-1] (original)
+++ branches/shell-experiments/base/shell/rshell/CMergedFolder.h [iso-8859-1] Wed Jul 2
14:48:21 2014
@@ -43,8 +43,8 @@
LPITEMIDLIST m_shellPidl;
public:
- CMergedFolder() {}
- virtual ~CMergedFolder() {}
+ CMergedFolder();
+ virtual ~CMergedFolder();
HRESULT _SetSources(IShellFolder* userLocal, IShellFolder* allUSers);
Modified: branches/shell-experiments/base/shell/rshell/rshell.spec
URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/rs…
==============================================================================
--- branches/shell-experiments/base/shell/rshell/rshell.spec [iso-8859-1] (original)
+++ branches/shell-experiments/base/shell/rshell/rshell.spec [iso-8859-1] Wed Jul 2
14:48:21 2014
@@ -2,3 +2,4 @@
@ stdcall CMenuDeskBar_Constructor(ptr ptr);
@ stdcall CMenuSite_Constructor(ptr ptr);
@ stdcall CMenuBand_Constructor(ptr ptr);
+@ stdcall CMergedFolder_Constructor(ptr ptr ptr ptr)
Modified: branches/shell-experiments/dll/win32/browseui/internettoolbar.cpp
URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/bro…
==============================================================================
--- branches/shell-experiments/dll/win32/browseui/internettoolbar.cpp [iso-8859-1]
(original)
+++ branches/shell-experiments/dll/win32/browseui/internettoolbar.cpp [iso-8859-1] Wed Jul
2 14:48:21 2014
@@ -74,6 +74,7 @@
extern HRESULT CreateAddressBand(REFIID riid, void **ppv);
typedef HRESULT(WINAPI * PMENUBAND_CONSTRUCTOR)(REFIID riid, void **ppv);
+typedef HRESULT(WINAPI * PMERGEDFOLDER_CONSTRUCTOR)(IShellFolder* userLocal,
IShellFolder* allUsers, REFIID riid, LPVOID *ppv);
HRESULT IUnknown_HasFocusIO(IUnknown * punk)
{
@@ -397,6 +398,9 @@
CComPtr<IShellMenu> newMenu;
CComPtr<IShellFolder> favoritesFolder;
LPITEMIDLIST favoritesPIDL;
+ CComPtr<IShellFolder> commonFavsFolder;
+ LPITEMIDLIST commonFavsPIDL;
+ CComPtr<IShellFolder> mergedFolder;
HWND ownerWindow;
HMENU parentHMenu;
HMENU favoritesHMenu;
@@ -456,7 +460,28 @@
return hResult;
RegCreateKeyEx(HKEY_CURRENT_USER, szFavoritesKey,
0, NULL, 0, KEY_READ | KEY_WRITE, NULL, &orderRegKey,
&disposition);
- hResult = newMenu->SetShellFolder(favoritesFolder, favoritesPIDL, orderRegKey,
SMSET_BOTTOM | 0x18);
+#if 1 /*USE_MERGED_FAVORITES*/
+ hResult = SHGetSpecialFolderLocation(NULL, CSIDL_COMMON_FAVORITES,
&commonFavsPIDL);
+ if (FAILED_UNEXPECTEDLY(hResult))
+ return hResult;
+ hResult = SHBindToFolder(commonFavsPIDL, &commonFavsFolder);
+ if (FAILED_UNEXPECTEDLY(hResult))
+ return hResult;
+ ILFree(commonFavsPIDL);
+
+ PMERGEDFOLDER_CONSTRUCTOR mfconstruct = (PMERGEDFOLDER_CONSTRUCTOR)
GetProcAddress(hrs, "CMergedFolder_Constructor");
+ if (mfconstruct)
+ {
+ hResult = mfconstruct(favoritesFolder, commonFavsFolder,
IID_PPV_ARG(IShellFolder, &mergedFolder));
+ }
+ else
+ {
+ mergedFolder = favoritesFolder;
+ }
+#else
+ mergedFolder = favoritesFolder;
+#endif
+ hResult = newMenu->SetShellFolder(mergedFolder, favoritesPIDL, orderRegKey,
SMSET_BOTTOM | SMINIT_CACHED | SMINV_ID);
ILFree(favoritesPIDL);
if (SUCCEEDED(hResult))
fFavoritesMenu.Attach(newMenu.Detach());
Modified: branches/shell-experiments/dll/win32/shlwapi/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/shl…
==============================================================================
--- branches/shell-experiments/dll/win32/shlwapi/CMakeLists.txt [iso-8859-1] (original)
+++ branches/shell-experiments/dll/win32/shlwapi/CMakeLists.txt [iso-8859-1] Wed Jul 2
14:48:21 2014
@@ -1,3 +1,5 @@
+
+project(SHELL)
add_definitions(
-D__WINESRC__