Author: dquintana
Date: Thu Dec 18 17:34:46 2014
New Revision: 65740
URL:
http://svn.reactos.org/svn/reactos?rev=65740&view=rev
Log:
[RSHELL]
* Fix the focus manager to properly close the shell menus when clicking outside the menu
area.
* Close the shell menus when activating a context menu action.
* Open the shell menus without activating. Fixes titlebar color changing to inactive for
the Favorites menu.
[RSHELL]
[SHELL32]
[BROWSEUI]
* Remove a few DbgPrints and downgrade some others into TRACEs.
CORE-8836 #resolve
Modified:
trunk/reactos/base/shell/explorer/taskswnd.cpp
trunk/reactos/base/shell/rshell/CMenuBand.cpp
trunk/reactos/base/shell/rshell/CMenuBand.h
trunk/reactos/base/shell/rshell/CMenuDeskBar.cpp
trunk/reactos/base/shell/rshell/CMenuFocusManager.cpp
trunk/reactos/base/shell/rshell/CMenuFocusManager.h
trunk/reactos/base/shell/rshell/CMenuToolbars.cpp
trunk/reactos/base/shell/rshell/CMenuToolbars.h
trunk/reactos/base/shell/rshell/ShellDDE.cpp
trunk/reactos/dll/win32/shell32/CDefView.cpp
trunk/reactos/dll/win32/shell32/CDesktopBrowser.cpp
trunk/reactos/dll/win32/shell32/dde.cpp
Modified: trunk/reactos/base/shell/explorer/taskswnd.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/explorer/tasksw…
==============================================================================
--- trunk/reactos/base/shell/explorer/taskswnd.cpp [iso-8859-1] (original)
+++ trunk/reactos/base/shell/explorer/taskswnd.cpp [iso-8859-1] Thu Dec 18 17:34:46 2014
@@ -1131,7 +1131,6 @@
if (Horizontal)
{
- DbgPrint("HORIZONTAL!\n");
TBMETRICS tbm = { 0 };
tbm.cbSize = sizeof(tbm);
tbm.dwMask = TBMF_BUTTONSPACING;
@@ -1145,7 +1144,6 @@
}
else
{
- DbgPrint("VERTICAL!\n");
uiBtnsPerLine = 1;
uiRows = m_ButtonCount;
}
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] Thu Dec 18 17:34:46 2014
@@ -439,7 +439,7 @@
if (m_subMenuChild)
{
- DbgPrint("Child object should have removed itself.\n");
+ TRACE("Child object should have removed itself.\n");
}
ShowDW(FALSE);
@@ -781,6 +781,10 @@
{
HRESULT hr;
UINT uCommand;
+
+ // Ensure that the menu doesn't disappear on us
+ CComPtr<IContextMenu> ctxMenu = contextMenu;
+
HMENU popup = CreatePopupMenu();
if (popup == NULL)
@@ -806,12 +810,15 @@
if (uCommand != 0)
{
+ _MenuItemSelect(MPOS_FULLCANCEL);
+
TRACE("Before InvokeCommand\n");
CMINVOKECOMMANDINFO cmi = { 0 };
cmi.cbSize = sizeof(cmi);
cmi.lpVerb = MAKEINTRESOURCEA(uCommand);
cmi.hwnd = hwnd;
hr = contextMenu->InvokeCommand(&cmi);
+ TRACE("InvokeCommand returned hr=%08x\n", hr);
}
else
{
@@ -843,7 +850,7 @@
if (m_staticToolbar) m_staticToolbar->ChangeHotItem(tb, id, dwFlags);
if (m_SFToolbar) m_SFToolbar->ChangeHotItem(tb, id, dwFlags);
- _MenuItemHotTrack(MPOS_CHILDTRACKING);
+ _MenuItemSelect(MPOS_CHILDTRACKING);
return S_OK;
@@ -904,7 +911,7 @@
return tb->KeyboardItemChange(change == VK_DOWN ? VK_HOME : VK_END);
}
-HRESULT CMenuBand::_MenuItemHotTrack(DWORD changeType)
+HRESULT CMenuBand::_MenuItemSelect(DWORD changeType)
{
CComPtr<CMenuBand> safeThis = this;
HRESULT hr;
@@ -959,7 +966,7 @@
}
case MPOS_SELECTLEFT:
if (m_parentBand && m_parentBand->_IsPopup()==S_FALSE)
- return m_parentBand->_MenuItemHotTrack(VK_LEFT);
+ return m_parentBand->_MenuItemSelect(VK_LEFT);
if (m_subMenuChild)
return m_subMenuChild->OnSelect(MPOS_CANCELLEVEL);
if (!m_subMenuParent)
@@ -970,7 +977,7 @@
if (m_hotBar && m_hotItem >= 0 &&
m_hotBar->PopupItem(m_hotItem, TRUE) == S_OK)
return S_FALSE;
if (m_parentBand)
- return m_parentBand->_MenuItemHotTrack(VK_RIGHT);
+ return m_parentBand->_MenuItemSelect(VK_RIGHT);
if (!m_subMenuParent)
return S_OK;
return m_subMenuParent->OnSelect(MPOS_SELECTRIGHT);
@@ -1093,12 +1100,12 @@
return hr;
}
-HRESULT CMenuBand::_MenuBarMouseDown(HWND hwnd, INT item)
+HRESULT CMenuBand::_MenuBarMouseDown(HWND hwnd, INT item, BOOL isLButton)
{
if (m_staticToolbar && m_staticToolbar->IsWindowOwner(hwnd) == S_OK)
- m_staticToolbar->MenuBarMouseDown(item);
+ m_staticToolbar->MenuBarMouseDown(item, isLButton);
if (m_SFToolbar && m_SFToolbar->IsWindowOwner(hwnd) == S_OK)
- m_SFToolbar->MenuBarMouseDown(item);
+ m_SFToolbar->MenuBarMouseDown(item, isLButton);
return S_OK;
}
Modified: trunk/reactos/base/shell/rshell/CMenuBand.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/rshell/CMenuBan…
==============================================================================
--- trunk/reactos/base/shell/rshell/CMenuBand.h [iso-8859-1] (original)
+++ trunk/reactos/base/shell/rshell/CMenuBand.h [iso-8859-1] Thu Dec 18 17:34:46 2014
@@ -186,7 +186,7 @@
HRESULT _GetTopLevelWindow(HWND*topLevel);
HRESULT _ChangeHotItem(CMenuToolbarBase * tb, INT id, DWORD dwFlags);
HRESULT _ChangePopupItem(CMenuToolbarBase * tb, INT id);
- HRESULT _MenuItemHotTrack(DWORD changeType);
+ HRESULT _MenuItemSelect(DWORD changeType);
HRESULT _CancelCurrentPopup();
HRESULT _OnPopupSubMenu(IShellMenu * childShellMenu, POINTL * pAt, RECTL * pExclude,
BOOL mouseInitiated);
HRESULT _BeforeCancelPopup();
@@ -196,7 +196,7 @@
HRESULT _IsPopup();
HRESULT _IsTracking();
HRESULT _KillPopupTimers();
- HRESULT _MenuBarMouseDown(HWND hwnd, INT item);
+ HRESULT _MenuBarMouseDown(HWND hwnd, INT item, BOOL isLButton);
HRESULT _MenuBarMouseUp(HWND hwnd, INT item);
HRESULT _HasSubMenu();
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] Thu Dec 18 17:34:46
2014
@@ -372,7 +372,9 @@
y = rcWorkArea.bottom - cy;
}
- this->SetWindowPos(HWND_TOPMOST, x, y, cx, cy, SWP_SHOWWINDOW);
+ int flags = SWP_SHOWWINDOW | SWP_NOACTIVATE;
+
+ this->SetWindowPos(HWND_TOPMOST, x, y, cx, cy, flags);
m_ShowFlags = dwFlags;
m_Shown = true;
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] Thu Dec 18 17:34:46
2014
@@ -163,7 +163,8 @@
m_isLButtonDown(FALSE),
m_movedSinceDown(FALSE),
m_windowAtDown(NULL),
- m_bandCount(0)
+ m_bandCount(0),
+ m_menuDepth(0)
{
m_ptPrev.x = 0;
m_ptPrev.y = 0;
@@ -207,7 +208,7 @@
m_mouseTrackDisabled = lastDisable;
}
-void CMenuFocusManager::SetCapture(HWND child)
+void CMenuFocusManager::SetMenuCapture(HWND child)
{
if (m_captureHwnd != child)
{
@@ -215,13 +216,13 @@
{
::SetCapture(child);
m_captureHwnd = child;
- TRACE("MouseTrack is now capturing %p\n", child);
+ TRACE("Capturing %p\n", child);
}
else
{
::ReleaseCapture();
m_captureHwnd = NULL;
- TRACE("MouseTrack is now off\n");
+ TRACE("Capture is now off\n");
}
}
@@ -305,7 +306,6 @@
if (cCapture && cCapture != m_captureHwnd && m_current->type !=
TrackedMenuEntry)
return TRUE;
-
m_movedSinceDown = TRUE;
m_ptPrev = pt;
@@ -344,8 +344,6 @@
{
m_entryUnderMouse->mb->_ChangeHotItem(NULL, -1, HICF_MOUSE);
}
- if (cCapture == m_captureHwnd)
- SetCapture(NULL);
}
if (m_hwndUnderMouse != child)
@@ -373,7 +371,7 @@
return TRUE;
}
-LRESULT CMenuFocusManager::ProcessMouseDown(MSG* msg)
+LRESULT CMenuFocusManager::ProcessMouseDown(MSG* msg, BOOL isLButton)
{
HWND child;
int iHitTestResult = -1;
@@ -418,7 +416,7 @@
if (iHitTestResult >= 0)
{
TRACE("MouseDown send %d\n", iHitTestResult);
- entry->mb->_MenuBarMouseDown(child, iHitTestResult);
+ entry->mb->_MenuBarMouseDown(child, iHitTestResult, isLButton);
}
}
@@ -521,13 +519,13 @@
case VK_LEFT:
if (m_current->hmenu == m_selectedMenu)
{
- m_parent->mb->_MenuItemHotTrack(VK_LEFT);
+ m_parent->mb->_MenuItemSelect(VK_LEFT);
}
break;
case VK_RIGHT:
if (m_selectedItem < 0 || !(m_selectedItemFlags & MF_POPUP))
{
- m_parent->mb->_MenuItemHotTrack(VK_RIGHT);
+ m_parent->mb->_MenuItemSelect(VK_RIGHT);
}
break;
}
@@ -555,9 +553,18 @@
switch (msg->message)
{
+ case WM_CAPTURECHANGED:
+ if (m_captureHwnd)
+ {
+ TRACE("Capture lost.\n");
+ m_captureHwnd = NULL;
+ }
+ break;
+
case WM_NCLBUTTONDOWN:
case WM_LBUTTONDOWN:
isLButton = TRUE;
+ TRACE("LB\n");
// fallthrough;
case WM_NCRBUTTONDOWN:
@@ -569,7 +576,7 @@
BOOL hoveringMenuBar = m_menuBar->mb->IsWindowOwner(child) ==
S_OK;
if (hoveringMenuBar)
{
- m_current->mb->_MenuItemHotTrack(MPOS_FULLCANCEL);
+ m_current->mb->_MenuItemSelect(MPOS_FULLCANCEL);
break;
}
}
@@ -580,16 +587,13 @@
if (IsTrackedWindowOrParent(child) != S_OK)
{
- SetCapture(NULL);
- m_current->mb->_MenuItemHotTrack(MPOS_FULLCANCEL);
+ m_current->mb->_MenuItemSelect(MPOS_FULLCANCEL);
break;
}
}
-
- if (isLButton)
- {
- ProcessMouseDown(msg);
- }
+
+ ProcessMouseDown(msg, isLButton);
+
break;
case WM_NCLBUTTONUP:
case WM_LBUTTONUP:
@@ -613,22 +617,22 @@
case VK_MENU:
case VK_LMENU:
case VK_RMENU:
- m_current->mb->_MenuItemHotTrack(MPOS_FULLCANCEL);
+ m_current->mb->_MenuItemSelect(MPOS_FULLCANCEL);
break;
case VK_RETURN:
- m_current->mb->_MenuItemHotTrack(MPOS_EXECUTE);
+ m_current->mb->_MenuItemSelect(MPOS_EXECUTE);
break;
case VK_LEFT:
- m_current->mb->_MenuItemHotTrack(VK_LEFT);
+ m_current->mb->_MenuItemSelect(VK_LEFT);
break;
case VK_RIGHT:
- m_current->mb->_MenuItemHotTrack(VK_RIGHT);
+ m_current->mb->_MenuItemSelect(VK_RIGHT);
break;
case VK_UP:
- m_current->mb->_MenuItemHotTrack(VK_UP);
+ m_current->mb->_MenuItemSelect(VK_UP);
break;
case VK_DOWN:
- m_current->mb->_MenuItemHotTrack(VK_DOWN);
+ m_current->mb->_MenuItemSelect(VK_DOWN);
break;
}
msg->message = WM_NULL;
@@ -672,13 +676,18 @@
HRESULT CMenuFocusManager::RemoveHooks()
{
- TRACE("Removing all hooks...\n");
if (m_hMsgFilterHook)
+ {
+ TRACE("Removing MSGFILTER hook...\n");
UnhookWindowsHookEx(m_hMsgFilterHook);
+ m_hMsgFilterHook = NULL;
+ }
if (m_hGetMsgHook)
+ {
+ TRACE("Removing GETMESSAGE hook...\n");
UnhookWindowsHookEx(m_hGetMsgHook);
- m_hMsgFilterHook = NULL;
- m_hGetMsgHook = NULL;
+ m_hGetMsgHook = NULL;
+ }
return S_OK;
}
@@ -688,15 +697,15 @@
StackEntry * old = m_current;
TRACE("UpdateFocus\n");
-
- if (old)
- SetCapture(NULL);
if (m_bandCount > 0)
m_current = &(m_bandStack[m_bandCount - 1]);
else
m_current = NULL;
+ if (!m_current || m_current->type != MenuPopupEntry)
+ SetMenuCapture(NULL);
+
if (m_current && m_current->type != TrackedMenuEntry)
{
hr = m_current->mb->_GetTopLevelWindow(&(m_current->hwnd));
@@ -747,24 +756,42 @@
DisableMouseTrack(m_parent->hwnd, TRUE);
}
- if ((m_current && m_current->type == MenuPopupEntry) &&
- (!m_parent || m_parent->type == MenuBarEntry))
- {
- // When the mouse moves, it should set itself to the proper band
- SetCapture(m_current->hwnd);
-
- if (old && old->type == TrackedMenuEntry)
- {
- // FIXME: Debugging code, probably not right
- POINT pt2;
- RECT rc2;
- GetCursorPos(&pt2);
- ScreenToClient(m_current->hwnd, &pt2);
- GetClientRect(m_current->hwnd, &rc2);
- if (PtInRect(&rc2, pt2))
- SendMessage(m_current->hwnd, WM_MOUSEMOVE, 0, MAKELPARAM(pt2.x,
pt2.y));
- else
- SendMessage(m_current->hwnd, WM_MOUSELEAVE, 0, 0);
+ if (m_current && m_current->type == MenuPopupEntry)
+ {
+ if (m_captureHwnd == NULL)
+ {
+ // We need to restore the capture after a non-shell submenu or context menu
is shown
+ StackEntry * topMenu = m_bandStack;
+ if (topMenu->type == MenuBarEntry)
+ topMenu++;
+
+ // Get the top-level window from the top popup
+ CComPtr<IServiceProvider> bandSite;
+ CComPtr<IOleWindow> deskBar;
+ hr = topMenu->mb->GetSite(IID_PPV_ARG(IServiceProvider,
&bandSite));
+ hr = bandSite->QueryService(SID_SMenuBandParent, IID_PPV_ARG(IOleWindow,
&deskBar));
+
+ // Get the HWND of the top-level window
+ HWND hWndSite;
+ hr = deskBar->GetWindow(&hWndSite);
+ SetMenuCapture(hWndSite);
+ }
+
+ if (!m_parent || m_parent->type == MenuBarEntry)
+ {
+ if (old && old->type == TrackedMenuEntry)
+ {
+ // FIXME: Debugging code, probably not right
+ POINT pt2;
+ RECT rc2;
+ GetCursorPos(&pt2);
+ ScreenToClient(m_current->hwnd, &pt2);
+ GetClientRect(m_current->hwnd, &rc2);
+ if (PtInRect(&rc2, pt2))
+ SendMessage(m_current->hwnd, WM_MOUSEMOVE, 0, MAKELPARAM(pt2.x,
pt2.y));
+ else
+ SendMessage(m_current->hwnd, WM_MOUSELEAVE, 0, 0);
+ }
}
}
@@ -775,7 +802,7 @@
HRESULT CMenuFocusManager::PushMenuBar(CMenuBand * mb)
{
- DbgPrint("PushMenuBar %p\n", mb);
+ TRACE("PushMenuBar %p\n", mb);
mb->AddRef();
@@ -790,7 +817,7 @@
HRESULT CMenuFocusManager::PushMenuPopup(CMenuBand * mb)
{
- DbgPrint("PushTrackedPopup %p\n", mb);
+ TRACE("PushTrackedPopup %p\n", mb);
mb->AddRef();
@@ -802,6 +829,8 @@
hr = UpdateFocus();
+ m_menuDepth++;
+
if (m_parent && m_parent->type != TrackedMenuEntry)
{
m_parent->mb->_SetChildBand(mb);
@@ -813,7 +842,7 @@
HRESULT CMenuFocusManager::PushTrackedPopup(HMENU popup)
{
- DbgPrint("PushTrackedPopup %p\n", popup);
+ TRACE("PushTrackedPopup %p\n", popup);
_ASSERT(m_bandCount > 0);
_ASSERT(!m_current || m_current->type != TrackedMenuEntry);
@@ -822,7 +851,7 @@
if (FAILED_UNEXPECTEDLY(hr))
return hr;
- DbgPrint("PushTrackedPopup %p\n", popup);
+ TRACE("PushTrackedPopup %p\n", popup);
m_selectedMenu = popup;
m_selectedItem = -1;
m_selectedItemFlags = 0;
@@ -836,7 +865,7 @@
CMenuBand * mbc;
HRESULT hr;
- DbgPrint("PopMenuBar %p\n", mb);
+ TRACE("PopMenuBar %p\n", mb);
if (m_current == m_entryUnderMouse)
{
@@ -880,12 +909,14 @@
CMenuBand * mbc;
HRESULT hr;
- DbgPrint("PopMenuPopup %p\n", mb);
+ TRACE("PopMenuPopup %p\n", mb);
if (m_current == m_entryUnderMouse)
{
m_entryUnderMouse = NULL;
}
+
+ m_menuDepth--;
hr = PopFromArray(&type, &mbc, NULL);
if (FAILED_UNEXPECTEDLY(hr))
@@ -924,7 +955,7 @@
HMENU hmenu;
HRESULT hr;
- DbgPrint("PopTrackedPopup %p\n", popup);
+ TRACE("PopTrackedPopup %p\n", popup);
hr = PopFromArray(&type, NULL, &hmenu);
if (FAILED_UNEXPECTEDLY(hr))
Modified: trunk/reactos/base/shell/rshell/CMenuFocusManager.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/rshell/CMenuFoc…
==============================================================================
--- trunk/reactos/base/shell/rshell/CMenuFocusManager.h [iso-8859-1] (original)
+++ trunk/reactos/base/shell/rshell/CMenuFocusManager.h [iso-8859-1] Thu Dec 18 17:34:46
2014
@@ -85,6 +85,7 @@
#define MAX_RECURSE 20
StackEntry m_bandStack[MAX_RECURSE];
int m_bandCount;
+ int m_menuDepth;
HRESULT PushToArray(StackEntryType type, CMenuBand * mb, HMENU hmenu);
HRESULT PopFromArray(StackEntryType * pType, CMenuBand ** pMb, HMENU * pHmenu);
@@ -110,10 +111,10 @@
HRESULT IsTrackedWindowOrParent(HWND hWnd);
void DisableMouseTrack(HWND parent, BOOL disableThis);
- void SetCapture(HWND child);
+ void SetMenuCapture(HWND child);
LRESULT ProcessMouseMove(MSG* msg);
- LRESULT ProcessMouseDown(MSG* msg);
+ LRESULT ProcessMouseDown(MSG* msg, BOOL isLButton);
LRESULT ProcessMouseUp(MSG* msg);
public:
HRESULT PushMenuBar(CMenuBand * mb);
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] Thu Dec 18 17:34:46
2014
@@ -73,9 +73,6 @@
//return OnHotItemChange(reinterpret_cast<LPNMTBHOTITEM>(hdr),
theResult);
return S_OK;
- case NM_RCLICK:
- return OnContextMenu(reinterpret_cast<LPNMMOUSE>(hdr));
-
case NM_CUSTOMDRAW:
return OnCustomDraw(reinterpret_cast<LPNMTBCUSTOMDRAW>(hdr),
theResult);
@@ -770,7 +767,7 @@
HRESULT CMenuToolbarBase::BeforeCancelPopup()
{
m_cancelingPopup = TRUE;
- DbgPrint("BeforeCancelPopup\n");
+ TRACE("BeforeCancelPopup\n");
return S_OK;
}
@@ -797,12 +794,29 @@
TRACE("Executing...\n");
- return m_menuBand->_MenuItemHotTrack(MPOS_EXECUTE);
-}
-
-HRESULT CMenuToolbarBase::MenuBarMouseDown(INT iIndex)
+ return m_menuBand->_MenuItemSelect(MPOS_EXECUTE);
+}
+
+HRESULT CMenuToolbarBase::ProcessContextMenu(INT iItem)
+{
+ INT index;
+ DWORD_PTR data;
+
+ GetDataFromId(iItem, &index, &data);
+
+ DWORD pos = GetMessagePos();
+ POINT pt = { GET_X_LPARAM(pos), GET_Y_LPARAM(pos) };
+
+ return InternalContextMenu(iItem, index, data, pt);
+}
+
+HRESULT CMenuToolbarBase::MenuBarMouseDown(INT iIndex, BOOL isLButton)
{
TBBUTTON btn;
+
+ GetButton(iIndex, &btn);
+ if (!isLButton)
+ return ProcessContextMenu(btn.idCommand);
if ((m_initFlags & SMINIT_VERTICAL)
|| m_popupBar
@@ -812,23 +826,22 @@
return S_OK;
}
+ return ProcessClick(btn.idCommand);
+}
+
+HRESULT CMenuToolbarBase::MenuBarMouseUp(INT iIndex)
+{
+ TBBUTTON btn;
+
+ m_cancelingPopup = FALSE;
+
+ if (!(m_initFlags & SMINIT_VERTICAL))
+ return S_OK;
+
GetButton(iIndex, &btn);
return ProcessClick(btn.idCommand);
}
-HRESULT CMenuToolbarBase::MenuBarMouseUp(INT iIndex)
-{
- TBBUTTON btn;
-
- m_cancelingPopup = FALSE;
-
- if (!(m_initFlags & SMINIT_VERTICAL))
- return S_OK;
-
- GetButton(iIndex, &btn);
- return ProcessClick(btn.idCommand);
-}
-
HRESULT CMenuToolbarBase::PrepareExecuteItem(INT iItem)
{
this->m_menuBand->_KillPopupTimers();
@@ -840,17 +853,6 @@
HRESULT CMenuToolbarBase::ExecuteItem()
{
return InternalExecuteItem(m_executeItem, m_executeItem, m_executeData);
-}
-
-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)
Modified: trunk/reactos/base/shell/rshell/CMenuToolbars.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/shell/rshell/CMenuToo…
==============================================================================
--- trunk/reactos/base/shell/rshell/CMenuToolbars.h [iso-8859-1] (original)
+++ trunk/reactos/base/shell/rshell/CMenuToolbars.h [iso-8859-1] Thu Dec 18 17:34:46 2014
@@ -96,9 +96,10 @@
HRESULT KillPopupTimer();
- HRESULT MenuBarMouseDown(INT iIndex);
+ HRESULT MenuBarMouseDown(INT iIndex, BOOL isLButton);
HRESULT MenuBarMouseUp(INT iIndex);
HRESULT ProcessClick(INT iItem);
+ HRESULT ProcessContextMenu(INT iItem);
HRESULT BeforeCancelPopup();
protected:
@@ -121,7 +122,6 @@
HRESULT UpdateImageLists();
HRESULT OnPagerCalcSize(LPNMPGCALCSIZE csize);
- HRESULT OnContextMenu(NMMOUSE * rclick);
HRESULT OnCustomDraw(LPNMTBCUSTOMDRAW cdraw, LRESULT * theResult);
HRESULT OnGetInfoTip(NMTBGETINFOTIP * tip);
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] Thu Dec 18 17:34:46 2014
@@ -56,7 +56,7 @@
DdeQueryStringW(dwDDEInst, hszTopic, szTopic, _countof(szTopic), CP_WINUNICODE);
DdeQueryStringW(dwDDEInst, hszService, szService, _countof(szService),
CP_WINUNICODE);
- DbgPrint("Dde_OnConnect: topic=%S, service=%S\n", szTopic, szService);
+ TRACE("Dde_OnConnect: topic=%S, service=%S\n", szTopic, szService);
return TRUE;
}
@@ -69,7 +69,7 @@
DdeQueryStringW(dwDDEInst, hszTopic, szTopic, _countof(szTopic), CP_WINUNICODE);
DdeQueryStringW(dwDDEInst, hszService, szService, _countof(szService),
CP_WINUNICODE);
- DbgPrint("Dde_OnConnectConfirm: hconv=%p, topic=%S, service=%S\n", hconv,
szTopic, szService);
+ TRACE("Dde_OnConnectConfirm: hconv=%p, topic=%S, service=%S\n", hconv,
szTopic, szService);
}
static BOOL Dde_OnWildConnect(HSZ hszTopic, HSZ hszService)
@@ -80,7 +80,7 @@
DdeQueryStringW(dwDDEInst, hszTopic, szTopic, _countof(szTopic), CP_WINUNICODE);
DdeQueryStringW(dwDDEInst, hszService, szService, _countof(szService),
CP_WINUNICODE);
- DbgPrint("Dde_OnWildConnect: topic=%S, service=%S\n", szTopic, szService);
+ TRACE("Dde_OnWildConnect: topic=%S, service=%S\n", szTopic, szService);
return FALSE;
}
@@ -93,7 +93,7 @@
DdeQueryStringW(dwDDEInst, hszTopic, szTopic, _countof(szTopic), CP_WINUNICODE);
DdeQueryStringW(dwDDEInst, hszItem, szItem, _countof(szItem), CP_WINUNICODE);
- DbgPrint("Dde_OnRequest: uFmt=%d, hconv=%p, topic=%S, item=%S\n", hconv,
szTopic, szItem);
+ TRACE("Dde_OnRequest: uFmt=%d, hconv=%p, topic=%S, item=%S\n", hconv,
szTopic, szItem);
return NULL;
}
@@ -140,7 +140,7 @@
DdeUnaccessData(hdata);
- DbgPrint("Dde_OnExecute: hconv=%p, topic=%S, command=%S\n", hconv, szTopic,
pszCommand);
+ TRACE("Dde_OnExecute: hconv=%p, topic=%S, command=%S\n", hconv, szTopic,
pszCommand);
/*
[ViewFolder("%l", %I, %S)] -- Open a folder in standard mode
@@ -261,7 +261,7 @@
UnknownParameter = StrToIntW(cmd);
}
- DbgPrint("Parse end: cmd=%S, S=%d, pidl=%p, path=%S\n", Command,
UnknownParameter, IdList, Path);
+ TRACE("Parse end: cmd=%S, S=%d, pidl=%p, path=%S\n", Command,
UnknownParameter, IdList, Path);
// Find handler in list
for (int i = 0; i < HandlerListLength; i++)
@@ -280,7 +280,7 @@
static void Dde_OnDisconnect(HCONV hconv)
{
- DbgPrint("Dde_OnDisconnect: hconv=%p\n", hconv);
+ TRACE("Dde_OnDisconnect: hconv=%p\n", hconv);
}
static HDDEDATA CALLBACK DdeCallback(
@@ -312,7 +312,7 @@
case XTYP_REGISTER:
return NULL;
default:
- DbgPrint("DdeCallback: unknown uType=%d\n", uType);
+ TRACE("DdeCallback: unknown uType=%d\n", uType);
return NULL;
}
}
@@ -330,7 +330,7 @@
*/
EXTERN_C void WINAPI ShellDDEInit(BOOL bInit)
{
- DbgPrint("ShellDDEInit bInit = %s\n", bInit ? "TRUE" :
"FALSE");
+ TRACE("ShellDDEInit bInit = %s\n", bInit ? "TRUE" :
"FALSE");
if (bInit && !bInitialized)
{
Modified: trunk/reactos/dll/win32/shell32/CDefView.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/CDefView…
==============================================================================
--- trunk/reactos/dll/win32/shell32/CDefView.cpp [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shell32/CDefView.cpp [iso-8859-1] Thu Dec 18 17:34:46 2014
@@ -1898,14 +1898,14 @@
MENUITEMINFOW mii = { 0 };
HMENU hSubmenu = (HMENU) wParam;
- DbgPrint("OnInitMenuPopup lParam=%d\n", lParam);
+ TRACE("OnInitMenuPopup lParam=%d\n", lParam);
mii.cbSize = sizeof(mii);
mii.fMask = MIIM_ID | MIIM_SUBMENU;
if (!GetMenuItemInfoW(this->m_hMenu, lParam, TRUE, &mii))
{
- DbgPrint("OnInitMenuPopup GetMenuItemInfoW failed!\n");
+ TRACE("OnInitMenuPopup GetMenuItemInfoW failed!\n");
return FALSE;
}
@@ -1913,11 +1913,11 @@
if (mii.hSubMenu != hSubmenu)
{
- DbgPrint("OnInitMenuPopup submenu does not match!!!!\n");
+ TRACE("OnInitMenuPopup submenu does not match!!!!\n");
return FALSE;
}
- DbgPrint("OnInitMenuPopup id=%d\n", menuItemId);
+ TRACE("OnInitMenuPopup id=%d\n", menuItemId);
switch (menuItemId)
{
Modified: trunk/reactos/dll/win32/shell32/CDesktopBrowser.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/CDesktop…
==============================================================================
--- trunk/reactos/dll/win32/shell32/CDesktopBrowser.cpp [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shell32/CDesktopBrowser.cpp [iso-8859-1] Thu Dec 18 17:34:46
2014
@@ -519,7 +519,7 @@
}
case WM_EXPLORER_OPEN_NEW_WINDOW:
- DbgPrint("Proxy Desktop message 1035 received.\n");
+ TRACE("Proxy Desktop message 1035 received.\n");
SHOnCWMCommandLine((HANDLE)lParam);
break;
Modified: trunk/reactos/dll/win32/shell32/dde.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/dde.cpp?…
==============================================================================
--- trunk/reactos/dll/win32/shell32/dde.cpp [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/shell32/dde.cpp [iso-8859-1] Thu Dec 18 17:34:46 2014
@@ -55,7 +55,7 @@
DdeQueryStringW(dwDDEInst, hszTopic, szTopic, _countof(szTopic), CP_WINUNICODE);
DdeQueryStringW(dwDDEInst, hszService, szService, _countof(szService),
CP_WINUNICODE);
- DbgPrint("Dde_OnConnect: topic=%S, service=%S\n", szTopic, szService);
+ TRACE("Dde_OnConnect: topic=%S, service=%S\n", szTopic, szService);
return TRUE;
}
@@ -68,7 +68,7 @@
DdeQueryStringW(dwDDEInst, hszTopic, szTopic, _countof(szTopic), CP_WINUNICODE);
DdeQueryStringW(dwDDEInst, hszService, szService, _countof(szService),
CP_WINUNICODE);
- DbgPrint("Dde_OnConnectConfirm: hconv=%p, topic=%S, service=%S\n", hconv,
szTopic, szService);
+ TRACE("Dde_OnConnectConfirm: hconv=%p, topic=%S, service=%S\n", hconv,
szTopic, szService);
}
static BOOL Dde_OnWildConnect(HSZ hszTopic, HSZ hszService)
@@ -79,7 +79,7 @@
DdeQueryStringW(dwDDEInst, hszTopic, szTopic, _countof(szTopic), CP_WINUNICODE);
DdeQueryStringW(dwDDEInst, hszService, szService, _countof(szService),
CP_WINUNICODE);
- DbgPrint("Dde_OnWildConnect: topic=%S, service=%S\n", szTopic, szService);
+ TRACE("Dde_OnWildConnect: topic=%S, service=%S\n", szTopic, szService);
return FALSE;
}
@@ -92,7 +92,7 @@
DdeQueryStringW(dwDDEInst, hszTopic, szTopic, _countof(szTopic), CP_WINUNICODE);
DdeQueryStringW(dwDDEInst, hszItem, szItem, _countof(szItem), CP_WINUNICODE);
- DbgPrint("Dde_OnRequest: uFmt=%d, hconv=%p, topic=%S, item=%S\n", hconv,
szTopic, szItem);
+ TRACE("Dde_OnRequest: uFmt=%d, hconv=%p, topic=%S, item=%S\n", hconv,
szTopic, szItem);
return NULL;
}
@@ -139,7 +139,7 @@
DdeUnaccessData(hdata);
- DbgPrint("Dde_OnExecute: hconv=%p, topic=%S, command=%S\n", hconv, szTopic,
pszCommand);
+ TRACE("Dde_OnExecute: hconv=%p, topic=%S, command=%S\n", hconv, szTopic,
pszCommand);
/*
[ViewFolder("%l", %I, %S)] -- Open a folder in standard mode
@@ -260,7 +260,7 @@
UnknownParameter = StrToIntW(cmd);
}
- DbgPrint("Parse end: cmd=%S, S=%d, pidl=%p, path=%S\n", Command,
UnknownParameter, IdList, Path);
+ TRACE("Parse end: cmd=%S, S=%d, pidl=%p, path=%S\n", Command,
UnknownParameter, IdList, Path);
// Find handler in list
for (int i = 0; i < HandlerListLength; i++)
@@ -279,7 +279,7 @@
static void Dde_OnDisconnect(HCONV hconv)
{
- DbgPrint("Dde_OnDisconnect: hconv=%p\n", hconv);
+ TRACE("Dde_OnDisconnect: hconv=%p\n", hconv);
}
static HDDEDATA CALLBACK DdeCallback(
@@ -311,7 +311,7 @@
case XTYP_REGISTER:
return NULL;
default:
- DbgPrint("DdeCallback: unknown uType=%d\n", uType);
+ WARN("DdeCallback: unknown uType=%d\n", uType);
return NULL;
}
}
@@ -329,7 +329,7 @@
*/
EXTERN_C void WINAPI ShellDDEInit(BOOL bInit)
{
- DbgPrint("ShellDDEInit bInit = %s\n", bInit ? "TRUE" :
"FALSE");
+ TRACE("ShellDDEInit bInit = %s\n", bInit ? "TRUE" :
"FALSE");
if (bInit && !bInitialized)
{