Author: dquintana
Date: Tue Apr 15 10:08:08 2014
New Revision: 62752
URL:
http://svn.reactos.org/svn/reactos?rev=62752&view=rev
Log:
[RSHELL]
* Fixed the context menu for shell items.
* Some more code style improvements.
* Moved the toggles between using system classes and rshell classes into the constructor
functions, so the code is easier to read.
CORE-7586
Modified:
branches/shell-experiments/base/shell/rshell/CMenuBand.cpp
branches/shell-experiments/base/shell/rshell/CMenuDeskBar.cpp
branches/shell-experiments/base/shell/rshell/CMenuSite.cpp
branches/shell-experiments/base/shell/rshell/CMenuToolbars.cpp
branches/shell-experiments/base/shell/rshell/CMenuToolbars.h
branches/shell-experiments/base/shell/rshell/CStartMenu.cpp
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] Tue Apr 15
10:08:08 2014
@@ -35,6 +35,12 @@
extern "C"
HRESULT WINAPI CMenuBand_Constructor(REFIID riid, LPVOID *ppv)
{
+#if USE_SYSTEM_MENUBAND
+ hr = CoCreateInstance(CLSID_MenuBand,
+ NULL,
+ CLSCTX_INPROC_SERVER,
+ riid, ppv);
+#else
*ppv = NULL;
CMenuBand * site = new CComObject<CMenuBand>();
@@ -48,6 +54,7 @@
site->Release();
return hr;
+#endif
}
CMenuBand::CMenuBand() :
@@ -687,18 +694,11 @@
HRESULT CMenuBand::_TrackSubMenu(HMENU popup, INT x, INT y, RECT& rcExclude)
{
TPMPARAMS params = { sizeof(TPMPARAMS), rcExclude };
-
- UINT flags = TPM_VERPOSANIMATION | TPM_VERTICAL | TPM_LEFTALIGN;
+ UINT flags = TPM_VERPOSANIMATION | TPM_VERTICAL | TPM_LEFTALIGN;
+ HWND hwnd = m_menuOwner ? m_menuOwner : m_topLevelWindow;
m_focusManager->PushTrackedPopup(popup);
- if (m_menuOwner)
- {
- ::TrackPopupMenuEx(popup, flags, x, y, m_menuOwner, ¶ms);
- }
- else
- {
- ::TrackPopupMenuEx(popup, flags, x, y, m_topLevelWindow, ¶ms);
- }
+ ::TrackPopupMenuEx(popup, flags, x, y, hwnd, ¶ms);
m_focusManager->PopTrackedPopup(popup);
_DisableMouseTrack(FALSE);
@@ -715,27 +715,34 @@
if (popup == NULL)
return E_FAIL;
+ DbgPrint("Before Query\n");
hr = contextMenu->QueryContextMenu(popup, 0, 0, UINT_MAX, CMF_NORMAL);
if (FAILED_UNEXPECTEDLY(hr))
{
+ DbgPrint("Query failed\n");
DestroyMenu(popup);
return hr;
}
HWND hwnd = m_menuOwner ? m_menuOwner : m_topLevelWindow;
- m_focusManager->PushTrackedPopup(popup);
- uCommand = ::TrackPopupMenuEx(popup, TPM_RETURNCMD, x, y, m_menuOwner, NULL);
- m_focusManager->PopTrackedPopup(popup);
-
- if (uCommand == 0)
- return S_FALSE;
-
- CMINVOKECOMMANDINFO cmi = { 0 };
- cmi.cbSize = sizeof(cmi);
- cmi.lpVerb = MAKEINTRESOURCEA(uCommand);
- cmi.hwnd = hwnd;
- hr = contextMenu->InvokeCommand(&cmi);
+ DbgPrint("Before Tracking\n");
+ uCommand = ::TrackPopupMenuEx(popup, TPM_RETURNCMD, x, y, hwnd, NULL);
+
+ if (uCommand != 0)
+ {
+ DbgPrint("Before InvokeCommand\n");
+ CMINVOKECOMMANDINFO cmi = { 0 };
+ cmi.cbSize = sizeof(cmi);
+ cmi.lpVerb = MAKEINTRESOURCEA(uCommand);
+ cmi.hwnd = hwnd;
+ hr = contextMenu->InvokeCommand(&cmi);
+ }
+ else
+ {
+ DbgPrint("TrackPopupMenu failed. Code=%d, LastError=%d\n", uCommand,
GetLastError());
+ hr = S_FALSE;
+ }
DestroyMenu(popup);
return hr;
@@ -787,7 +794,7 @@
if (!tb)
{
// If no hot item was selected
- // choose the first toolbar (prefer shell-folder, which will be positionedat the
top)
+ // choose the first toolbar (prefer shell-folder, which will be positioned at the
top)
if (m_SFToolbar)
tb = m_SFToolbar;
@@ -895,26 +902,11 @@
IDeskBar* pDeskBar;
// Create the necessary objects
-
-#if USE_SYSTEM_MENUSITE
- hr = CoCreateInstance(CLSID_MenuBandSite,
- NULL,
- CLSCTX_INPROC_SERVER,
- IID_PPV_ARG(IBandSite, &pBandSite));
-#else
hr = CMenuSite_Constructor(IID_PPV_ARG(IBandSite, &pBandSite));
-#endif
- if (FAILED_UNEXPECTEDLY(hr))
- return hr;
-
-#if USE_SYSTEM_MENUDESKBAR
- hr = CoCreateInstance(CLSID_MenuDeskBar,
- NULL,
- CLSCTX_INPROC_SERVER,
- IID_PPV_ARG(IDeskBar, &pDeskBar));
-#else
+ if (FAILED_UNEXPECTEDLY(hr))
+ return hr;
+
hr = CMenuDeskBar_Constructor(IID_PPV_ARG(IDeskBar, &pDeskBar));
-#endif
if (FAILED_UNEXPECTEDLY(hr))
return hr;
Modified: branches/shell-experiments/base/shell/rshell/CMenuDeskBar.cpp
URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/rs…
==============================================================================
--- branches/shell-experiments/base/shell/rshell/CMenuDeskBar.cpp [iso-8859-1] (original)
+++ branches/shell-experiments/base/shell/rshell/CMenuDeskBar.cpp [iso-8859-1] Tue Apr 15
10:08:08 2014
@@ -30,6 +30,12 @@
extern "C"
HRESULT WINAPI CMenuDeskBar_Constructor(REFIID riid, LPVOID *ppv)
{
+#if USE_SYSTEM_MENUDESKBAR
+ hr = CoCreateInstance(CLSID_MenuDeskBar,
+ NULL,
+ CLSCTX_INPROC_SERVER,
+ riid, ppv);
+#else
*ppv = NULL;
CMenuDeskBar * deskbar = new CComObject<CMenuDeskBar>();
@@ -43,6 +49,7 @@
deskbar->Release();
return hr;
+#endif
}
CMenuDeskBar::CMenuDeskBar() :
Modified: branches/shell-experiments/base/shell/rshell/CMenuSite.cpp
URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/rs…
==============================================================================
--- branches/shell-experiments/base/shell/rshell/CMenuSite.cpp [iso-8859-1] (original)
+++ branches/shell-experiments/base/shell/rshell/CMenuSite.cpp [iso-8859-1] Tue Apr 15
10:08:08 2014
@@ -28,6 +28,12 @@
extern "C"
HRESULT WINAPI CMenuSite_Constructor(REFIID riid, LPVOID *ppv)
{
+#if USE_SYSTEM_MENUSITE
+ hr = CoCreateInstance(CLSID_MenuBandSite,
+ NULL,
+ CLSCTX_INPROC_SERVER,
+ riid, ppv);
+#else
*ppv = NULL;
CMenuSite * site = new CComObject<CMenuSite>();
@@ -41,6 +47,7 @@
site->Release();
return hr;
+#endif
}
CMenuSite::CMenuSite() :
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] Tue Apr 15
10:08:08 2014
@@ -539,7 +539,7 @@
GetDataFromId(iItem, &index, &dwData);
- return GetInfoTip(tip->pszText, tip->cchTextMax, iItem, index, dwData);
+ return InternalGetTooltip(iItem, index, dwData, tip->pszText,
tip->cchTextMax);
}
HRESULT CMenuToolbarBase::OnPopupTimer(DWORD timerId)
@@ -784,13 +784,14 @@
return S_OK;
}
-HRESULT CMenuToolbarBase::DoContextMenu(IContextMenu* contextMenu)
-{
- // Calculate the context menu position
- DWORD dwPos = GetMessagePos();
- POINT pt = { GET_X_LPARAM(dwPos), GET_Y_LPARAM(dwPos) };
-
- // Display the submenu
+HRESULT CMenuToolbarBase::TrackContextMenu(IContextMenu* contextMenu, POINT pt)
+{
+ // Cancel submenus
+ m_menuBand->_KillPopupTimers();
+ if (m_popupBar)
+ m_menuBand->_CancelCurrentPopup();
+
+ // Display the context menu
return m_menuBand->_TrackContextMenu(contextMenu, pt.x, pt.y);
}
@@ -827,7 +828,24 @@
if (FAILED_UNEXPECTEDLY(hr))
return hr;
- return OnCommandInternal(wParam, lParam, theResult);
+ INT iItem = wParam;
+ INT index;
+ DWORD_PTR data;
+
+ GetDataFromId(iItem, &index, &data);
+
+ return InternalExecuteItem(iItem, index, data);
+}
+
+HRESULT CMenuToolbarBase::OnContextMenu(NMMOUSE * rclick)
+{
+ INT iItem = rclick->dwItemSpec;
+ INT index = rclick->dwHitInfo;
+ DWORD_PTR data = rclick->dwItemData;
+
+ GetDataFromId(iItem, &index, &data);
+
+ return InternalContextMenu(iItem, index, data, rclick->pt);
}
HRESULT CMenuToolbarBase::KeyboardItemChange(DWORD dwSelectType)
@@ -838,14 +856,6 @@
if (dwSelectType != 0xFFFFFFFF)
{
int count = SendMessage(m_hwndToolbar, TB_BUTTONCOUNT, 0, 0);
-
- if (m_hotItem >= 0)
- {
- TBBUTTONINFO info = { 0 };
- info.cbSize = sizeof(TBBUTTONINFO);
- info.dwMask = 0;
- index = SendMessage(m_hwndToolbar, TB_GETBUTTONINFO, m_hotItem,
reinterpret_cast<LPARAM>(&info));
- }
if (dwSelectType == VK_HOME)
{
@@ -857,19 +867,57 @@
index = count - 1;
dwSelectType = VK_UP;
}
- else if (index < 0)
+ else
{
- if (dwSelectType == VK_UP)
+ if (m_hotItem >= 0)
{
- index = count - 1;
+ TBBUTTONINFO info = { 0 };
+ info.cbSize = sizeof(TBBUTTONINFO);
+ info.dwMask = 0;
+ index = SendMessage(m_hwndToolbar, TB_GETBUTTONINFO, m_hotItem,
reinterpret_cast<LPARAM>(&info));
}
- else if (dwSelectType == VK_DOWN)
+
+ if (index < 0)
{
- index = 0;
+ if (dwSelectType == VK_UP)
+ {
+ index = count - 1;
+ }
+ else if (dwSelectType == VK_DOWN)
+ {
+ index = 0;
+ }
+ }
+ else
+ {
+ if (dwSelectType == VK_UP)
+ {
+ index--;
+ }
+ else if (dwSelectType == VK_DOWN)
+ {
+ index++;
+ }
}
}
- else
+
+ TBBUTTON btn = { 0 };
+ while (index >= 0 && index < count)
{
+ DWORD res = SendMessage(m_hwndToolbar, TB_GETBUTTON, index,
reinterpret_cast<LPARAM>(&btn));
+ if (!res)
+ return E_FAIL;
+
+ if (btn.dwData)
+ {
+ if (prev != btn.idCommand)
+ {
+ TRACE("Setting Hot item to %d\n", index);
+ m_menuBand->_ChangeHotItem(this, index, 0);
+ }
+ return S_OK;
+ }
+
if (dwSelectType == VK_UP)
{
index--;
@@ -879,33 +927,6 @@
index++;
}
}
-
- TBBUTTON btn = { 0 };
- while (index >= 0 && index < count)
- {
- DWORD res = SendMessage(m_hwndToolbar, TB_GETBUTTON, index,
reinterpret_cast<LPARAM>(&btn));
- if (!res)
- return E_FAIL;
-
- if (btn.dwData)
- {
- if (prev != btn.idCommand)
- {
- TRACE("Setting Hot item to %d\n", index);
- m_menuBand->_ChangeHotItem(this, index, 0);
- }
- return S_OK;
- }
-
- if (dwSelectType == VK_UP)
- {
- index--;
- }
- else if (dwSelectType == VK_DOWN)
- {
- index++;
- }
- }
}
if (prev != -1)
@@ -980,6 +1001,15 @@
return S_OK;
}
+HRESULT CMenuToolbarBase::ClearToolbar()
+{
+ while (SendMessage(m_hwndToolbar, TB_DELETEBUTTON, 0, 0))
+ {
+ // empty;
+ }
+ return S_OK;
+}
+
HRESULT CMenuToolbarBase::GetDataFromId(INT iItem, INT* pIndex, DWORD_PTR* pData)
{
if (pData)
@@ -1086,10 +1116,7 @@
if (clearFirst)
{
- while (SendMessage(m_hwndToolbar, TB_DELETEBUTTON, 0, 0))
- {
- // empty;
- }
+ ClearToolbar();
}
int count = 0;
@@ -1141,7 +1168,7 @@
return S_OK;
}
-HRESULT CMenuStaticToolbar::GetInfoTip(LPWSTR pszText, INT cchTextMax, INT iItem, INT
index, DWORD_PTR dwData)
+HRESULT CMenuStaticToolbar::InternalGetTooltip(INT iItem, INT index, DWORD_PTR dwData,
LPWSTR pszText, INT cchTextMax)
{
//SMINFO * info = reinterpret_cast<SMINFO*>(dwData);
UNIMPLEMENTED;
@@ -1154,19 +1181,20 @@
return S_OK;
}
-HRESULT CMenuStaticToolbar::OnContextMenu(NMMOUSE * rclick)
+HRESULT CMenuStaticToolbar::InternalContextMenu(INT iItem, INT index, DWORD_PTR dwData,
POINT pt)
{
CComPtr<IContextMenu> contextMenu;
- HRESULT hr = m_menuBand->_CallCBWithItemId(rclick->dwItemSpec, SMC_GETOBJECT,
reinterpret_cast<WPARAM>(&IID_IContextMenu),
reinterpret_cast<LPARAM>(&contextMenu));
+ HRESULT hr = m_menuBand->_CallCBWithItemId(iItem, SMC_GETOBJECT,
+ reinterpret_cast<WPARAM>(&IID_IContextMenu),
reinterpret_cast<LPARAM>(&contextMenu));
if (hr != S_OK)
return hr;
- return DoContextMenu(contextMenu);
-}
-
-HRESULT CMenuStaticToolbar::OnCommandInternal(WPARAM wParam, LPARAM lParam, LRESULT
*theResult)
-{
- return m_menuBand->_CallCBWithItemId(wParam, SMC_EXEC, 0, 0);
+ return TrackContextMenu(contextMenu, pt);
+}
+
+HRESULT CMenuStaticToolbar::InternalExecuteItem(INT iItem, INT index, DWORD_PTR data)
+{
+ return m_menuBand->_CallCBWithItemId(iItem, SMC_EXEC, 0, 0);
}
HRESULT CMenuStaticToolbar::InternalPopupItem(INT iItem, INT index, DWORD_PTR dwData)
@@ -1214,7 +1242,7 @@
PWSTR MenuString;
IEnumIDList * eidl;
- m_shellFolder->EnumObjects(m_hwndToolbar, SHCONTF_FOLDERS | SHCONTF_NONFOLDERS,
&eidl);
+ m_shellFolder->EnumObjects(GetToolbar(), SHCONTF_FOLDERS | SHCONTF_NONFOLDERS,
&eidl);
LPITEMIDLIST item =
static_cast<LPITEMIDLIST>(CoTaskMemAlloc(sizeof(ITEMIDLIST)));
ULONG fetched;
@@ -1259,7 +1287,7 @@
return hr;
}
-HRESULT CMenuSFToolbar::GetInfoTip(LPWSTR pszText, INT cchTextMax, INT iItem, INT index,
DWORD_PTR dwData)
+HRESULT CMenuSFToolbar::InternalGetTooltip(INT iItem, INT index, DWORD_PTR dwData, LPWSTR
pszText, INT cchTextMax)
{
//ITEMIDLIST * pidl = reinterpret_cast<LPITEMIDLIST>(dwData);
UNIMPLEMENTED;
@@ -1312,25 +1340,27 @@
return hr;
}
-HRESULT CMenuSFToolbar::OnContextMenu(NMMOUSE * rclick)
+HRESULT CMenuSFToolbar::InternalContextMenu(INT iItem, INT index, DWORD_PTR dwData, POINT
pt)
{
HRESULT hr;
- CComPtr<IContextMenu> contextMenu;
- LPCITEMIDLIST pidl = reinterpret_cast<LPCITEMIDLIST>(rclick->dwItemData);
-
- hr = m_shellFolder->GetUIObjectOf(m_hwndToolbar, 1, &pidl, IID_IContextMenu,
NULL, reinterpret_cast<VOID **>(&contextMenu));
- if (hr != S_OK)
+ CComPtr<IContextMenu> contextMenu = NULL;
+ LPCITEMIDLIST pidl = reinterpret_cast<LPCITEMIDLIST>(dwData);
+
+#define IID_NULL_PPV_ARG(Itype, ppType) IID_##Itype, NULL,
reinterpret_cast<void**>((static_cast<Itype**>(ppType)))
+
+ hr = m_shellFolder->GetUIObjectOf(GetToolbar(), 1, &pidl,
IID_NULL_PPV_ARG(IContextMenu, &contextMenu));
+ if (FAILED_UNEXPECTEDLY(hr))
+ {
return hr;
-
- return DoContextMenu(contextMenu);
-}
-
-HRESULT CMenuSFToolbar::OnCommandInternal(WPARAM wParam, LPARAM lParam, LRESULT
*theResult)
-{
- DWORD_PTR data;
-
- GetDataFromId(wParam, NULL, &data);
-
+ }
+
+ hr = TrackContextMenu(contextMenu, pt);
+
+ return hr;
+}
+
+HRESULT CMenuSFToolbar::InternalExecuteItem(INT iItem, INT index, DWORD_PTR data)
+{
return m_menuBand->_CallCBWithItemPidl(reinterpret_cast<LPITEMIDLIST>(data),
SMC_SFEXEC, 0, 0);
}
@@ -1348,14 +1378,7 @@
if (!pidl)
return E_FAIL;
-#if USE_SYSTEM_MENUBAND
- hr = CoCreateInstance(CLSID_MenuBand,
- NULL,
- CLSCTX_INPROC_SERVER,
- IID_PPV_ARG(IShellMenu, &shellMenu));
-#else
hr = CMenuBand_Constructor(IID_PPV_ARG(IShellMenu, &shellMenu));
-#endif
if (FAILED_UNEXPECTEDLY(hr))
return hr;
Modified: branches/shell-experiments/base/shell/rshell/CMenuToolbars.h
URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/rs…
==============================================================================
--- branches/shell-experiments/base/shell/rshell/CMenuToolbars.h [iso-8859-1] (original)
+++ branches/shell-experiments/base/shell/rshell/CMenuToolbars.h [iso-8859-1] Tue Apr 15
10:08:08 2014
@@ -25,20 +25,19 @@
#define WM_USER_ISTRACKEDITEM (WM_APP+41)
#define WM_USER_CHANGETRACKEDITEM (WM_APP+42)
-
class CMenuToolbarBase
{
private:
- HWND m_hwnd; // May be the pager
- HFONT m_marlett;
- BOOL m_useFlatMenus;
+ HWND m_hwnd; // May be the pager
+ HWND m_hwndToolbar;
+ HFONT m_marlett;
+ BOOL m_useFlatMenus;
WNDPROC m_SubclassOld;
- BOOL m_disableMouseTrack;
- BOOL m_timerEnabled;
+ BOOL m_disableMouseTrack;
+ BOOL m_timerEnabled;
protected:
CMenuBand * m_menuBand;
- HWND m_hwndToolbar;
DWORD m_dwMenuFlags;
BOOL m_hasSizes;
SIZE m_idealSize;
@@ -54,6 +53,8 @@
private:
static LRESULT CALLBACK s_SubclassProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM
lParam);
+
+ LRESULT SubclassProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
public:
CMenuToolbarBase(CMenuBand *menuBand, BOOL usePager);
@@ -72,7 +73,7 @@
HRESULT PopupSubMenu(UINT itemId, UINT index, IShellMenu* childShellMenu);
HRESULT PopupSubMenu(UINT itemId, UINT index, HMENU menu);
- HRESULT DoContextMenu(IContextMenu* contextMenu);
+ HRESULT TrackContextMenu(IContextMenu* contextMenu, POINT pt);
HRESULT KeyboardItemChange(DWORD changeType);
@@ -87,8 +88,7 @@
HRESULT DisableMouseTrack(BOOL bDisable);
virtual HRESULT FillToolbar(BOOL clearFirst=FALSE) = 0;
- virtual HRESULT OnContextMenu(NMMOUSE * rclick) = 0;
-
+
HRESULT CancelCurrentPopup();
HRESULT PopupItem(INT iItem);
HRESULT GetDataFromId(INT iItem, INT* pIndex, DWORD_PTR* pData);
@@ -96,26 +96,28 @@
HRESULT KillPopupTimer();
protected:
- virtual HRESULT OnCommandInternal(WPARAM wParam, LPARAM lParam, LRESULT *theResult) =
0;
+ virtual HRESULT OnDeletingButton(const NMTOOLBAR * tb) = 0;
- virtual HRESULT OnDeletingButton(const NMTOOLBAR * tb) = 0;
+ virtual HRESULT InternalGetTooltip(INT iItem, INT index, DWORD_PTR dwData, LPWSTR
pszText, INT cchTextMax) = 0;
+ virtual HRESULT InternalExecuteItem(INT iItem, INT index, DWORD_PTR dwData) = 0;
virtual HRESULT InternalPopupItem(INT iItem, INT index, DWORD_PTR dwData) = 0;
virtual HRESULT InternalHasSubMenu(INT iItem, INT index, DWORD_PTR dwData) = 0;
-
- virtual HRESULT GetInfoTip(LPWSTR pszText, INT cchTextMax, INT iItem, INT index,
DWORD_PTR dwData)=0;
-
- LRESULT CALLBACK SubclassProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
+ virtual HRESULT InternalContextMenu(INT iItem, INT index, DWORD_PTR dwData, POINT pt)
= 0;
HRESULT AddButton(DWORD commandId, LPCWSTR caption, BOOL hasSubMenu, INT iconId,
DWORD_PTR buttonData, BOOL last);
HRESULT AddSeparator(BOOL last);
HRESULT AddPlaceholder();
+ HRESULT ClearToolbar();
+ HWND GetToolbar() { return m_hwndToolbar; }
+
+private:
HRESULT UpdateImageLists();
-private:
HRESULT OnCommand(WPARAM wParam, LPARAM lParam, LRESULT *theResult);
HRESULT OnPagerCalcSize(LPNMPGCALCSIZE csize);
HRESULT OnPopupTimer(DWORD timerId);
+ HRESULT OnContextMenu(NMMOUSE * rclick);
HRESULT OnCustomDraw(LPNMTBCUSTOMDRAW cdraw, LRESULT * theResult);
HRESULT OnGetInfoTip(NMTBGETINFOTIP * tip);
};
@@ -134,16 +136,15 @@
HRESULT GetMenu(HMENU *phmenu, HWND *phwnd, DWORD *pdwFlags);
virtual HRESULT FillToolbar(BOOL clearFirst=FALSE);
- virtual HRESULT OnCommandInternal(WPARAM wParam, LPARAM lParam, LRESULT *theResult);
- virtual HRESULT OnContextMenu(NMMOUSE * rclick);
protected:
virtual HRESULT OnDeletingButton(const NMTOOLBAR * tb);
- virtual HRESULT GetInfoTip(LPWSTR pszText, INT cchTextMax, INT iItem, INT index,
DWORD_PTR dwData);
-
+ virtual HRESULT InternalGetTooltip(INT iItem, INT index, DWORD_PTR dwData, LPWSTR
pszText, INT cchTextMax);
+ virtual HRESULT InternalExecuteItem(INT iItem, INT index, DWORD_PTR dwData);
virtual HRESULT InternalPopupItem(INT iItem, INT index, DWORD_PTR dwData);
virtual HRESULT InternalHasSubMenu(INT iItem, INT index, DWORD_PTR dwData);
+ virtual HRESULT InternalContextMenu(INT iItem, INT index, DWORD_PTR dwData, POINT
pt);
};
class CMenuSFToolbar :
@@ -162,14 +163,13 @@
HRESULT GetShellFolder(DWORD *pdwFlags, LPITEMIDLIST *ppidl, REFIID riid, void
**ppv);
virtual HRESULT FillToolbar(BOOL clearFirst=FALSE);
- virtual HRESULT OnCommandInternal(WPARAM wParam, LPARAM lParam, LRESULT *theResult);
- virtual HRESULT OnContextMenu(NMMOUSE * rclick);
protected:
virtual HRESULT OnDeletingButton(const NMTOOLBAR * tb);
- virtual HRESULT GetInfoTip(LPWSTR pszText, INT cchTextMax, INT iItem, INT index,
DWORD_PTR dwData);
-
+ virtual HRESULT InternalGetTooltip(INT iItem, INT index, DWORD_PTR dwData, LPWSTR
pszText, INT cchTextMax);
+ virtual HRESULT InternalExecuteItem(INT iItem, INT index, DWORD_PTR dwData);
virtual HRESULT InternalPopupItem(INT iItem, INT index, DWORD_PTR dwData);
virtual HRESULT InternalHasSubMenu(INT iItem, INT index, DWORD_PTR dwData);
+ virtual HRESULT InternalContextMenu(INT iItem, INT index, DWORD_PTR dwData, POINT
pt);
};
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] Tue Apr 15
10:08:08 2014
@@ -148,14 +148,7 @@
case IDM_DOCUMENTS: csidl = CSIDL_RECENT; break;
}
-#if USE_SYSTEM_MENUBAND
- hr = CoCreateInstance(CLSID_MenuBand,
- NULL,
- CLSCTX_INPROC_SERVER,
- IID_PPV_ARG(IShellMenu, &pShellMenu));
-#else
hr = CMenuBand_Constructor(IID_PPV_ARG(IShellMenu, &pShellMenu));
-#endif
if (FAILED_UNEXPECTEDLY(hr))
return hr;
@@ -291,36 +284,15 @@
IShellFolder *psfStartMenuAll;
#endif
-#if USE_SYSTEM_MENUBAND
- hr = CoCreateInstance(CLSID_MenuBand,
- NULL,
- CLSCTX_INPROC_SERVER,
- IID_PPV_ARG(IShellMenu, &pShellMenu));
-#else
hr = CMenuBand_Constructor(IID_PPV_ARG(IShellMenu, &pShellMenu));
-#endif
- if (FAILED_UNEXPECTEDLY(hr))
- return hr;
-
-#if USE_SYSTEM_MENUSITE
- hr = CoCreateInstance(CLSID_MenuBandSite,
- NULL,
- CLSCTX_INPROC_SERVER,
- IID_PPV_ARG(IBandSite, &pBandSite));
-#else
+ if (FAILED_UNEXPECTEDLY(hr))
+ return hr;
+
hr = CMenuSite_Constructor(IID_PPV_ARG(IBandSite, &pBandSite));
-#endif
- if (FAILED_UNEXPECTEDLY(hr))
- return hr;
-
-#if USE_SYSTEM_MENUDESKBAR
- hr = CoCreateInstance(CLSID_MenuDeskBar,
- NULL,
- CLSCTX_INPROC_SERVER,
- IID_PPV_ARG(IDeskBar, &pDeskBar));
-#else
+ if (FAILED_UNEXPECTEDLY(hr))
+ return hr;
+
hr = CMenuDeskBar_Constructor(IID_PPV_ARG(IDeskBar, &pDeskBar));
-#endif
if (FAILED_UNEXPECTEDLY(hr))
return hr;