Author: dquintana
Date: Mon Feb 2 22:06:59 2015
New Revision: 66150
URL: http://svn.reactos.org/svn/reactos?rev=66150&view=rev
Log:
[RSHELL]
* Add comments in some key places.
* Reshuffled the order of a few methods.
Modified:
trunk/reactos/base/shell/rshell/CMenuBand.cpp
trunk/reactos/base/shell/rshell/CMenuDeskBar.cpp
trunk/reactos/base/shell/rshell/CMenuFocusManager.cpp
trunk/reactos/base/shell/rshell/CMenuSite.cpp
trunk/reactos/base/shell/rshell/CMenuToolbars.cpp
trunk/reactos/base/shell/rshell/CMergedFolder.cpp
trunk/reactos/base/shell/rshell/CStartMenu.cpp
trunk/reactos/base/shell/rshell/ShellDDE.cpp
Modified: trunk/reactos/base/shell/rshell/CMenuBand.cpp
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/rshell/CMenuBan…
==============================================================================
--- trunk/reactos/base/shell/rshell/CMenuBand.cpp [iso-8859-1] (original)
+++ trunk/reactos/base/shell/rshell/CMenuBand.cpp [iso-8859-1] Mon Feb 2 22:06:59 2015
@@ -128,6 +128,8 @@
HWND hwnd,
DWORD dwFlags)
{
+ HRESULT hr;
+
TRACE("CMenuBand::SetMenu called, hmenu=%p; hwnd=%p, flags=%x\n", hmenu, hwnd, dwFlags);
BOOL created = FALSE;
@@ -138,17 +140,21 @@
m_hmenu = NULL;
}
- if (m_staticToolbar == NULL)
+ m_hmenu = hmenu;
+ m_menuOwner = hwnd;
+
+ if (m_hmenu && m_staticToolbar == NULL)
{
m_staticToolbar = new CMenuStaticToolbar(this);
created = true;
}
- m_hmenu = hmenu;
- m_menuOwner = hwnd;
-
- HRESULT hr = m_staticToolbar->SetMenu(hmenu, hwnd, dwFlags);
- if (FAILED_UNEXPECTEDLY(hr))
- return hr;
+
+ if (m_staticToolbar)
+ {
+ hr = m_staticToolbar->SetMenu(hmenu, hwnd, dwFlags);
+ if (FAILED_UNEXPECTEDLY(hr))
+ return hr;
+ }
if (m_site)
{
@@ -287,8 +293,11 @@
int syStatic = maxStatic.cy;
int syShlFld = sy - syStatic;
+ // TODO: Windows has a more complex system to decide ordering.
+ // Because we only support two toolbars at once, this is enough for us.
if (m_shellBottom)
{
+ // Static menu on top
if (m_SFToolbar)
{
m_SFToolbar->SetPosSize(
@@ -306,8 +315,9 @@
syStatic);
}
}
- else // shell menu on top
- {
+ else
+ {
+ // Folder menu on top
if (m_SFToolbar)
{
m_SFToolbar->SetPosSize(
@@ -547,6 +557,10 @@
HRESULT STDMETHODCALLTYPE CMenuBand::OnSelect(DWORD dwSelectType)
{
+ // When called from outside, this is straightforward:
+ // Things that a submenu needs to know, are spread down, and
+ // things that the parent needs to know, are spread up. No drama.
+ // The fun is in _MenuItemSelect (internal method).
switch (dwSelectType)
{
case MPOS_CHILDTRACKING:
@@ -585,6 +599,7 @@
return S_OK;
}
+// Used by the focus manager to update the child band pointer
HRESULT CMenuBand::_SetChildBand(CMenuBand * child)
{
m_childBand = child;
@@ -595,6 +610,7 @@
return S_OK;
}
+// User by the focus manager to update the parent band pointer
HRESULT CMenuBand::_SetParentBand(CMenuBand * parent)
{
m_parentBand = parent;
@@ -633,7 +649,6 @@
HRESULT STDMETHODCALLTYPE CMenuBand::GetClient(IUnknown **ppunkClient)
{
- // HACK, so I can test for a submenu in the DeskBar
if (!ppunkClient)
return E_POINTER;
*ppunkClient = NULL;
@@ -754,7 +769,6 @@
smData.pidlItem = pidl;
smData.hwnd = m_menuOwner ? m_menuOwner : m_topLevelWindow;
smData.hmenu = m_hmenu;
- smData.pvUserData = NULL;
if (m_SFToolbar)
m_SFToolbar->GetShellFolder(NULL, &smData.pidlFolder, IID_PPV_ARG(IShellFolder, &smData.psf));
HRESULT hr = m_psmc->CallbackSM(&smData, uMsg, wParam, lParam);
@@ -859,7 +873,6 @@
if (m_SFToolbar) m_SFToolbar->ChangeHotItem(tb, id, dwFlags);
_MenuItemSelect(MPOS_CHILDTRACKING);
-
return S_OK;
}
@@ -921,6 +934,7 @@
HRESULT CMenuBand::_MenuItemSelect(DWORD changeType)
{
+ // Needed to prevent the this point from vanishing mid-function
CComPtr<CMenuBand> safeThis = this;
HRESULT hr;
@@ -957,6 +971,9 @@
}
}
+ // In this context, the parent is the CMenuDeskBar, so when it bubbles upward,
+ // it is notifying the deskbar, and not the the higher-level menu.
+ // Same for the child: since it points to a CMenuDeskBar, it's not just recursing.
switch (changeType)
{
case MPOS_EXECUTE:
Modified: trunk/reactos/base/shell/rshell/CMenuDeskBar.cpp
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/rshell/CMenuDes…
==============================================================================
--- trunk/reactos/base/shell/rshell/CMenuDeskBar.cpp [iso-8859-1] (original)
+++ trunk/reactos/base/shell/rshell/CMenuDeskBar.cpp [iso-8859-1] Mon Feb 2 22:06:59 2015
@@ -23,6 +23,26 @@
#include "CMenuDeskBar.h"
+/* As far as I can tell, the submenu hierarchy looks like this:
+*
+* The DeskBar's Child is the Band it contains.
+* The DeskBar's Parent is the SID_SMenuPopup of the Site.
+*
+* The Band's Child is the IMenuPopup of the child submenu.
+* The Band's Parent is the SID_SMenuPopup of the Site (the DeskBar).
+*
+* When the DeskBar receives a selection event:
+* If it requires closing the window, it will notify the Child (Band) using CancelLevel.
+* If it has to spread upwards (everything but CancelLevel), it will notify the Parent.
+*
+* When the Band receives a selection event, this is where it gets fuzzy:
+* In which cases does it call the Parent? Probably not CancelLevel.
+* In which cases does it call the Child?
+* How does it react to calls?
+*
+*/
+
+
WINE_DEFAULT_DEBUG_CHANNEL(CMenuDeskBar);
extern "C"
@@ -576,26 +596,6 @@
HRESULT STDMETHODCALLTYPE CMenuDeskBar::OnSelect(DWORD dwSelectType)
{
CComPtr<IDeskBar> safeThis = this;
-
- /* As far as I can tell, the submenu hierarchy looks like this:
- *
- * The DeskBar's Child is the Band it contains.
- * The DeskBar's Parent is the SID_SMenuPopup of the Site.
- *
- * The Band's Child is the IMenuPopup of the child submenu.
- * The Band's Parent is the SID_SMenuPopup of the Site (the DeskBar).
- *
- * When the DeskBar receives a selection event:
- * If it requires closing the window, it will notify the Child (Band) using CancelLevel.
- * If it has to spread upwards (everything but CancelLevel), it will notify the Parent.
- *
- * When the Band receives a selection event, this is where it gets fuzzy:
- * In which cases does it call the Parent? Probably not CancelLevel.
- * In which cases does it call the Child?
- * How does it react to calls?
- *
- */
-
CComPtr<IMenuPopup> oldParent = m_SubMenuParent;
TRACE("OnSelect dwSelectType=%d\n", this, dwSelectType);
@@ -623,9 +623,11 @@
HRESULT CMenuDeskBar::_CloseBar()
{
- CComPtr<IDeskBar> safeThis = this;
CComPtr<IDeskBarClient> dbc;
HRESULT hr;
+
+ // Ensure that our data isn't destroyed while we are working
+ CComPtr<IDeskBar> safeThis = this;
m_Shown = false;
Modified: trunk/reactos/base/shell/rshell/CMenuFocusManager.cpp
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/rshell/CMenuFoc…
==============================================================================
--- trunk/reactos/base/shell/rshell/CMenuFocusManager.cpp [iso-8859-1] (original)
+++ trunk/reactos/base/shell/rshell/CMenuFocusManager.cpp [iso-8859-1] Mon Feb 2 22:06:59 2015
@@ -17,6 +17,28 @@
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
+
+/*
+This file implements the CMenuFocusManager class.
+
+This class manages the shell menus, by overriding the hot-tracking behaviour.
+
+For the shell menus, it uses a GetMessage hook,
+where it intercepts messages directed to the menu windows.
+
+In order to show submenus using system popups, it also has a MessageFilter hook.
+
+The menu is tracked using a stack structure. When a CMenuBand wants to open a submenu,
+it pushes the submenu band, or HMENU to track in case of system popups,
+and when the menu has closed, it pops the same pointer or handle.
+
+While a shell menu is open, it overrides the menu toolbar's hottracking behaviour,
+using its own logic to track both the active menu item, and the opened submenu's parent item.
+
+While a system popup is open, it tracks the mouse movements so that it can cancel the popup,
+and switch to another submenu when the mouse goes over another item from the parent.
+
+*/
#include "precomp.h"
#include <windowsx.h>
#include <commoncontrols.h>
@@ -65,11 +87,13 @@
DWORD CMenuFocusManager::TlsIndex = 0;
+// Gets the thread's assigned manager without refcounting
CMenuFocusManager * CMenuFocusManager::GetManager()
{
return reinterpret_cast<CMenuFocusManager *>(TlsGetValue(TlsIndex));
}
+// Obtains a manager for the thread, with refcounting
CMenuFocusManager * CMenuFocusManager::AcquireManager()
{
CMenuFocusManager * obj = NULL;
@@ -93,6 +117,7 @@
return obj;
}
+// Releases a previously acquired manager, and deletes it if the refcount reaches 0
void CMenuFocusManager::ReleaseManager(CMenuFocusManager * obj)
{
if (!obj->Release())
@@ -176,6 +201,7 @@
{
}
+// Used so that the toolbar can properly ignore mouse events, when the menu is being used with the keyboard
void CMenuFocusManager::DisableMouseTrack(HWND parent, BOOL disableThis)
{
BOOL bDisable = FALSE;
@@ -328,6 +354,8 @@
if (SendMessage(child, WM_USER_ISTRACKEDITEM, iHitTestResult, 0) == S_FALSE)
{
+ // The current tracked item has changed, notify the toolbar
+
TRACE("Hot item tracking detected a change (capture=%p / cCapture=%p)...\n", m_captureHwnd, cCapture);
DisableMouseTrack(NULL, FALSE);
if (isTracking && iHitTestResult >= 0 && m_current->type == TrackedMenuEntry)
@@ -692,6 +720,7 @@
return S_OK;
}
+// Used to update the tracking info to account for a change in the top-level menu
HRESULT CMenuFocusManager::UpdateFocus()
{
HRESULT hr;
@@ -699,11 +728,13 @@
TRACE("UpdateFocus\n");
+ // Assign the new current item
if (m_bandCount > 0)
m_current = &(m_bandStack[m_bandCount - 1]);
else
m_current = NULL;
+ // Remove the menu capture if necesary
if (!m_current || m_current->type != MenuPopupEntry)
{
SetMenuCapture(NULL);
@@ -714,6 +745,7 @@
}
}
+ // Obtain the top-level window for the new active menu
if (m_current && m_current->type != TrackedMenuEntry)
{
hr = m_current->mb->_GetTopLevelWindow(&(m_current->hwnd));
@@ -721,6 +753,7 @@
return hr;
}
+ // Refresh the parent pointer
if (m_bandCount >= 2)
{
m_parent = &(m_bandStack[m_bandCount - 2]);
@@ -731,6 +764,7 @@
m_parent = NULL;
}
+ // Refresh the menubar pointer, if applicable
if (m_bandCount >= 1 && m_bandStack[0].type == MenuBarEntry)
{
m_menuBar = &(m_bandStack[0]);
@@ -740,6 +774,7 @@
m_menuBar = NULL;
}
+ // Remove the old hooks if the menu type changed, or we don't have a menu anymore
if (old && (!m_current || old->type != m_current->type))
{
if (m_current && m_current->type != TrackedMenuEntry)
@@ -752,6 +787,7 @@
return hr;
}
+ // And place new ones if necessary
if (m_current && (!old || old->type != m_current->type))
{
hr = PlaceHooks();
@@ -759,6 +795,7 @@
return hr;
}
+ // Give the user a chance to move the mouse to the new menu
if (m_parent)
{
DisableMouseTrack(m_parent->hwnd, TRUE);
@@ -822,6 +859,7 @@
return S_OK;
}
+// Begin tracking top-level menu bar (for file browser windows)
HRESULT CMenuFocusManager::PushMenuBar(CMenuBand * mb)
{
TRACE("PushMenuBar %p\n", mb);
@@ -837,6 +875,7 @@
return UpdateFocus();
}
+// Begin tracking a shell menu popup (start menu or submenus)
HRESULT CMenuFocusManager::PushMenuPopup(CMenuBand * mb)
{
TRACE("PushTrackedPopup %p\n", mb);
@@ -862,6 +901,7 @@
return hr;
}
+// Begin tracking a system popup submenu (submenu of the file browser windows)
HRESULT CMenuFocusManager::PushTrackedPopup(HMENU popup)
{
TRACE("PushTrackedPopup %p\n", popup);
@@ -881,6 +921,7 @@
return UpdateFocus();
}
+// Stop tracking the menubar
HRESULT CMenuFocusManager::PopMenuBar(CMenuBand * mb)
{
StackEntryType type;
@@ -925,6 +966,7 @@
return S_OK;
}
+// Stop tracking a shell menu
HRESULT CMenuFocusManager::PopMenuPopup(CMenuBand * mb)
{
StackEntryType type;
@@ -971,6 +1013,7 @@
return S_OK;
}
+// Stop tracking a system popup submenu
HRESULT CMenuFocusManager::PopTrackedPopup(HMENU popup)
{
StackEntryType type;
Modified: trunk/reactos/base/shell/rshell/CMenuSite.cpp
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/rshell/CMenuSit…
==============================================================================
--- trunk/reactos/base/shell/rshell/CMenuSite.cpp [iso-8859-1] (original)
+++ trunk/reactos/base/shell/rshell/CMenuSite.cpp [iso-8859-1] Mon Feb 2 22:06:59 2015
@@ -40,55 +40,12 @@
{
}
-HRESULT STDMETHODCALLTYPE CMenuSite::ContextSensitiveHelp(BOOL fEnterMode)
-{
- return E_NOTIMPL;
-}
-
-HRESULT STDMETHODCALLTYPE CMenuSite::GetBandSiteInfo(BANDSITEINFO *pbsinfo)
-{
- return E_NOTIMPL;
-}
-
-HRESULT STDMETHODCALLTYPE CMenuSite::RemoveBand(DWORD dwBandID)
-{
- return E_NOTIMPL;
-}
-
-HRESULT STDMETHODCALLTYPE CMenuSite::SetBandSiteInfo(const BANDSITEINFO *pbsinfo)
-{
- return E_NOTIMPL;
-}
-
-HRESULT STDMETHODCALLTYPE CMenuSite::SetBandState(DWORD dwBandID, DWORD dwMask, DWORD dwState)
-{
- return E_NOTIMPL;
-}
-
-HRESULT STDMETHODCALLTYPE CMenuSite::SetModeDBC(DWORD dwMode)
-{
- return E_NOTIMPL;
-}
-
-HRESULT STDMETHODCALLTYPE CMenuSite::TranslateAcceleratorIO(LPMSG lpMsg)
-{
- return S_FALSE;
-}
-
-HRESULT STDMETHODCALLTYPE CMenuSite::HasFocusIO()
-{
- return S_FALSE;
-}
-
-HRESULT STDMETHODCALLTYPE CMenuSite::OnFocusChangeIS(IUnknown *punkObj, BOOL fSetFocus)
-{
- return S_OK;
-}
-
+// Child Band management (simplified due to only supporting one single child)
HRESULT STDMETHODCALLTYPE CMenuSite::AddBand(IUnknown * punk)
{
HRESULT hr;
+ // Little helper, for readability
#define TO_HRESULT(x) ((HRESULT)(S_OK+(x)))
CComPtr<IUnknown> pUnknown;
@@ -144,11 +101,6 @@
return S_OK;
}
-HRESULT STDMETHODCALLTYPE CMenuSite::Exec(const GUID * pguidCmdGroup, DWORD nCmdID, DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut)
-{
- return IUnknown_Exec(m_DeskBarSite, *pguidCmdGroup, nCmdID, nCmdexecopt, pvaIn, pvaOut);
-}
-
HRESULT STDMETHODCALLTYPE CMenuSite::GetBandObject(DWORD dwBandID, REFIID riid, VOID **ppv)
{
if (dwBandID != 0 || m_BandObject == NULL)
@@ -160,6 +112,27 @@
return m_BandObject->QueryInterface(riid, ppv);
}
+HRESULT STDMETHODCALLTYPE CMenuSite::QueryBand(DWORD dwBandID, IDeskBand **ppstb, DWORD *pdwState, LPWSTR pszName, int cchName)
+{
+ if (dwBandID != 0)
+ return E_FAIL;
+
+ if (!m_BandObject)
+ {
+ *ppstb = NULL;
+ return E_NOINTERFACE;
+ }
+
+ HRESULT hr = m_BandObject->QueryInterface(IID_PPV_ARG(IDeskBand, ppstb));
+
+ *pdwState = 1;
+
+ if (cchName > 0)
+ pszName[0] = 0;
+
+ return hr;
+}
+
HRESULT STDMETHODCALLTYPE CMenuSite::GetSize(DWORD dwWhich, LPRECT prc)
{
memset(prc, 0, sizeof(*prc));
@@ -208,27 +181,6 @@
return S_OK;
return m_WinEventHandler->OnWinEvent(hWnd, uMsg, wParam, lParam, theResult);
-}
-
-HRESULT STDMETHODCALLTYPE CMenuSite::QueryBand(DWORD dwBandID, IDeskBand **ppstb, DWORD *pdwState, LPWSTR pszName, int cchName)
-{
- if (dwBandID != 0)
- return E_FAIL;
-
- if (!m_BandObject)
- {
- *ppstb = NULL;
- return E_NOINTERFACE;
- }
-
- HRESULT hr = m_BandObject->QueryInterface(IID_PPV_ARG(IDeskBand, ppstb));
-
- *pdwState = 1;
-
- if (cchName > 0)
- pszName[0] = 0;
-
- return hr;
}
HRESULT STDMETHODCALLTYPE CMenuSite::QueryService(REFGUID guidService, REFIID riid, void **ppvObject)
@@ -251,11 +203,15 @@
return IUnknown_QueryService(m_DeskBarSite, guidService, riid, ppvObject);
}
+HRESULT STDMETHODCALLTYPE CMenuSite::Exec(const GUID * pguidCmdGroup, DWORD nCmdID, DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut)
+{
+ // Forward Exec calls directly to the parent deskbar
+ return IUnknown_Exec(m_DeskBarSite, *pguidCmdGroup, nCmdID, nCmdexecopt, pvaIn, pvaOut);
+}
+
HRESULT STDMETHODCALLTYPE CMenuSite::QueryStatus(const GUID * pguidCmdGroup, ULONG cCmds, OLECMD prgCmds [], OLECMDTEXT *pCmdText)
{
- if (!m_DeskBarSite)
- return E_FAIL;
-
+ // Forward QueryStatus calls directly to the parent deskbar
return IUnknown_QueryStatus(m_DeskBarSite, *pguidCmdGroup, cCmds, prgCmds, pCmdText);
}
@@ -265,6 +221,7 @@
CComPtr<IUnknown> protectThis(this->ToIUnknown());
+ // Only initialize if a parent site is being assigned
if (punkSite)
{
HWND hWndSite;
@@ -282,23 +239,24 @@
}
m_DeskBarSite = punkSite;
-
- return S_OK;
- }
-
- if (m_DeskBand)
- {
- m_DeskBand->CloseDW(0);
- }
-
- hr = IUnknown_SetSite(m_BandObject, NULL);
-
- m_BandObject = NULL;
- m_DeskBand = NULL;
- m_WinEventHandler = NULL;
- m_hWndBand = NULL;
- m_hWnd = NULL;
- m_DeskBarSite = NULL;
+ }
+ else
+ {
+ // Otherwise, deinitialize.
+ if (m_DeskBand)
+ {
+ m_DeskBand->CloseDW(0);
+ }
+
+ hr = IUnknown_SetSite(m_BandObject, NULL);
+
+ m_BandObject = NULL;
+ m_DeskBand = NULL;
+ m_WinEventHandler = NULL;
+ m_hWndBand = NULL;
+ m_hWnd = NULL;
+ m_DeskBarSite = NULL;
+ }
return S_OK;
}
@@ -359,3 +317,48 @@
return FALSE;
}
+
+HRESULT STDMETHODCALLTYPE CMenuSite::ContextSensitiveHelp(BOOL fEnterMode)
+{
+ return E_NOTIMPL;
+}
+
+HRESULT STDMETHODCALLTYPE CMenuSite::GetBandSiteInfo(BANDSITEINFO *pbsinfo)
+{
+ return E_NOTIMPL;
+}
+
+HRESULT STDMETHODCALLTYPE CMenuSite::RemoveBand(DWORD dwBandID)
+{
+ return E_NOTIMPL;
+}
+
+HRESULT STDMETHODCALLTYPE CMenuSite::SetBandSiteInfo(const BANDSITEINFO *pbsinfo)
+{
+ return E_NOTIMPL;
+}
+
+HRESULT STDMETHODCALLTYPE CMenuSite::SetBandState(DWORD dwBandID, DWORD dwMask, DWORD dwState)
+{
+ return E_NOTIMPL;
+}
+
+HRESULT STDMETHODCALLTYPE CMenuSite::SetModeDBC(DWORD dwMode)
+{
+ return E_NOTIMPL;
+}
+
+HRESULT STDMETHODCALLTYPE CMenuSite::TranslateAcceleratorIO(LPMSG lpMsg)
+{
+ return S_FALSE;
+}
+
+HRESULT STDMETHODCALLTYPE CMenuSite::HasFocusIO()
+{
+ return S_FALSE;
+}
+
+HRESULT STDMETHODCALLTYPE CMenuSite::OnFocusChangeIS(IUnknown *punkObj, BOOL fSetFocus)
+{
+ return S_OK;
+}
Modified: trunk/reactos/base/shell/rshell/CMenuToolbars.cpp
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/rshell/CMenuToo…
==============================================================================
--- trunk/reactos/base/shell/rshell/CMenuToolbars.cpp [iso-8859-1] (original)
+++ trunk/reactos/base/shell/rshell/CMenuToolbars.cpp [iso-8859-1] Mon Feb 2 22:06:59 2015
@@ -1189,7 +1189,6 @@
SMINFO * sminfo = new SMINFO();
sminfo->dwMask = SMIM_ICON | SMIM_FLAGS;
- // FIXME: remove before deleting the toolbar or it will leak
HRESULT hr = m_menuBand->_CallCBWithItemId(info.wID, SMC_GETINFO, 0, reinterpret_cast<LPARAM>(sminfo));
if (FAILED_UNEXPECTEDLY(hr))
Modified: trunk/reactos/base/shell/rshell/CMergedFolder.cpp
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/rshell/CMergedF…
==============================================================================
--- trunk/reactos/base/shell/rshell/CMergedFolder.cpp [iso-8859-1] (original)
+++ trunk/reactos/base/shell/rshell/CMergedFolder.cpp [iso-8859-1] Mon Feb 2 22:06:59 2015
@@ -152,6 +152,7 @@
DSA_DeleteAllItems(m_hDsa);
m_hDsaCount = 0;
+ // The sources are not ordered so load all of the items for the user folder first
TRACE("Loading Local entries...\n");
for (;;)
{
@@ -186,6 +187,7 @@
m_hDsaCount++;
}
+ // Then load the items for the common folder
TRACE("Loading Common entries...\n");
for (;;)
{
@@ -213,6 +215,8 @@
ILFree(pidl);
+ // Try to find an existing entry with the same name, and makr it as shared.
+ // FIXME: This is sub-optimal, a hash table would be a lot more efficient.
BOOL bShared = FALSE;
for (int i = 0; i < (int)m_hDsaCount; i++)
{
@@ -235,6 +239,7 @@
}
}
+ // If an entry was not found, add a new one for this item
if (!bShared)
{
TRACE("Inserting item %d with name %S\n", m_hDsaCount, name);
Modified: trunk/reactos/base/shell/rshell/CStartMenu.cpp
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/rshell/CStartMe…
==============================================================================
--- trunk/reactos/base/shell/rshell/CStartMenu.cpp [iso-8859-1] (original)
+++ trunk/reactos/base/shell/rshell/CStartMenu.cpp [iso-8859-1] Mon Feb 2 22:06:59 2015
@@ -232,8 +232,8 @@
HRESULT OnExec(LPSMDATA psmd)
{
- // HACK: Instead of running explorer.exe with the path, we should be using ShellExecute to "open" the path directly!
- // Remove once ShellExecute can handle CLSID path components.
+ // HACK: Because our ShellExecute can't handle CLSID components in paths, we can't launch the paths using the "open" verb.
+ // FIXME: Change this back to using the path as the filename and the "open" verb, once ShellExecute can handle CLSID path components.
if (psmd->uId == IDM_CONTROLPANEL)
ShellExecuteW(NULL, NULL, L"explorer.exe", L"::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\\::{21EC2020-3AEA-1069-A2DD-08002B30309D}", NULL, SW_SHOWNORMAL);
Modified: trunk/reactos/base/shell/rshell/ShellDDE.cpp
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/rshell/ShellDDE…
==============================================================================
--- trunk/reactos/base/shell/rshell/ShellDDE.cpp [iso-8859-1] (original)
+++ trunk/reactos/base/shell/rshell/ShellDDE.cpp [iso-8859-1] Mon Feb 2 22:06:59 2015
@@ -22,6 +22,9 @@
#include <ddeml.h>
#include <strsafe.h>
#include <shlwapi_undoc.h>
+
+/* WARNING: Although this is a functional implementation of the DDE parsing, the handlers are not implemented here.
+The actual working implementation is in shell32 instead. */
WINE_DEFAULT_DEBUG_CHANNEL(shelldde);