diff --git a/reactos/base/shell/explorer/taskswnd.cpp b/reactos/base/shell/explorer/taskswnd.cpp index 9af02e3a94b..e47217e62e7 100644 --- a/reactos/base/shell/explorer/taskswnd.cpp +++ b/reactos/base/shell/explorer/taskswnd.cpp @@ -1131,7 +1131,6 @@ public: if (Horizontal) { - DbgPrint("HORIZONTAL!\n"); TBMETRICS tbm = { 0 }; tbm.cbSize = sizeof(tbm); tbm.dwMask = TBMF_BUTTONSPACING; @@ -1145,7 +1144,6 @@ public: } else { - DbgPrint("VERTICAL!\n"); uiBtnsPerLine = 1; uiRows = m_ButtonCount; } diff --git a/reactos/base/shell/rshell/CMenuBand.cpp b/reactos/base/shell/rshell/CMenuBand.cpp index e010637f6ab..a57f5149755 100644 --- a/reactos/base/shell/rshell/CMenuBand.cpp +++ b/reactos/base/shell/rshell/CMenuBand.cpp @@ -439,7 +439,7 @@ HRESULT STDMETHODCALLTYPE CMenuBand::CloseDW(DWORD dwReserved) 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 CMenuBand::_TrackContextMenu(IContextMenu * contextMenu, INT x, INT y) { HRESULT hr; UINT uCommand; + + // Ensure that the menu doesn't disappear on us + CComPtr ctxMenu = contextMenu; + HMENU popup = CreatePopupMenu(); if (popup == NULL) @@ -806,12 +810,15 @@ HRESULT CMenuBand::_TrackContextMenu(IContextMenu * contextMenu, INT x, INT y) 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 @@ HRESULT CMenuBand::_ChangeHotItem(CMenuToolbarBase * tb, INT id, DWORD dwFlags) 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 @@ HRESULT CMenuBand::_KeyboardItemChange(DWORD change) return tb->KeyboardItemChange(change == VK_DOWN ? VK_HOME : VK_END); } -HRESULT CMenuBand::_MenuItemHotTrack(DWORD changeType) +HRESULT CMenuBand::_MenuItemSelect(DWORD changeType) { CComPtr safeThis = this; HRESULT hr; @@ -959,7 +966,7 @@ HRESULT CMenuBand::_MenuItemHotTrack(DWORD changeType) } 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 @@ HRESULT CMenuBand::_MenuItemHotTrack(DWORD changeType) 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 @@ HRESULT CMenuBand::_KillPopupTimers() 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; } diff --git a/reactos/base/shell/rshell/CMenuBand.h b/reactos/base/shell/rshell/CMenuBand.h index 8d1d5b6f682..60fe4f6a4be 100644 --- a/reactos/base/shell/rshell/CMenuBand.h +++ b/reactos/base/shell/rshell/CMenuBand.h @@ -186,7 +186,7 @@ public: 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 @@ public: 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(); diff --git a/reactos/base/shell/rshell/CMenuDeskBar.cpp b/reactos/base/shell/rshell/CMenuDeskBar.cpp index 25876288e43..39617b02c80 100644 --- a/reactos/base/shell/rshell/CMenuDeskBar.cpp +++ b/reactos/base/shell/rshell/CMenuDeskBar.cpp @@ -372,7 +372,9 @@ HRESULT STDMETHODCALLTYPE CMenuDeskBar::Popup(POINTL *ppt, RECTL *prcExclude, MP 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; diff --git a/reactos/base/shell/rshell/CMenuFocusManager.cpp b/reactos/base/shell/rshell/CMenuFocusManager.cpp index 0f76919ea54..5936622838d 100644 --- a/reactos/base/shell/rshell/CMenuFocusManager.cpp +++ b/reactos/base/shell/rshell/CMenuFocusManager.cpp @@ -163,7 +163,8 @@ CMenuFocusManager::CMenuFocusManager() : 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 @@ void CMenuFocusManager::DisableMouseTrack(HWND parent, BOOL disableThis) m_mouseTrackDisabled = lastDisable; } -void CMenuFocusManager::SetCapture(HWND child) +void CMenuFocusManager::SetMenuCapture(HWND child) { if (m_captureHwnd != child) { @@ -215,13 +216,13 @@ void CMenuFocusManager::SetCapture(HWND child) { ::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 @@ LRESULT CMenuFocusManager::ProcessMouseMove(MSG* msg) if (cCapture && cCapture != m_captureHwnd && m_current->type != TrackedMenuEntry) return TRUE; - m_movedSinceDown = TRUE; m_ptPrev = pt; @@ -344,8 +344,6 @@ LRESULT CMenuFocusManager::ProcessMouseMove(MSG* msg) { m_entryUnderMouse->mb->_ChangeHotItem(NULL, -1, HICF_MOUSE); } - if (cCapture == m_captureHwnd) - SetCapture(NULL); } if (m_hwndUnderMouse != child) @@ -373,7 +371,7 @@ LRESULT CMenuFocusManager::ProcessMouseMove(MSG* msg) return TRUE; } -LRESULT CMenuFocusManager::ProcessMouseDown(MSG* msg) +LRESULT CMenuFocusManager::ProcessMouseDown(MSG* msg, BOOL isLButton) { HWND child; int iHitTestResult = -1; @@ -418,7 +416,7 @@ LRESULT CMenuFocusManager::ProcessMouseDown(MSG* msg) if (iHitTestResult >= 0) { TRACE("MouseDown send %d\n", iHitTestResult); - entry->mb->_MenuBarMouseDown(child, iHitTestResult); + entry->mb->_MenuBarMouseDown(child, iHitTestResult, isLButton); } } @@ -521,13 +519,13 @@ LRESULT CMenuFocusManager::MsgFilterHook(INT nCode, WPARAM hookWParam, LPARAM ho 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 @@ LRESULT CMenuFocusManager::GetMsgHook(INT nCode, WPARAM hookWParam, LPARAM hookL 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 @@ LRESULT CMenuFocusManager::GetMsgHook(INT nCode, WPARAM hookWParam, LPARAM hookL 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 @@ LRESULT CMenuFocusManager::GetMsgHook(INT nCode, WPARAM hookWParam, LPARAM hookL 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 @@ LRESULT CMenuFocusManager::GetMsgHook(INT nCode, WPARAM hookWParam, LPARAM hookL 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::PlaceHooks() 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; } @@ -689,14 +698,14 @@ HRESULT CMenuFocusManager::UpdateFocus() 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 @@ HRESULT CMenuFocusManager::UpdateFocus() DisableMouseTrack(m_parent->hwnd, TRUE); } - if ((m_current && m_current->type == MenuPopupEntry) && - (!m_parent || m_parent->type == MenuBarEntry)) + if (m_current && m_current->type == MenuPopupEntry) { - // When the mouse moves, it should set itself to the proper band - SetCapture(m_current->hwnd); - - if (old && old->type == TrackedMenuEntry) + if (m_captureHwnd == NULL) { - // 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); + // 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 bandSite; + CComPtr 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::UpdateFocus() HRESULT CMenuFocusManager::PushMenuBar(CMenuBand * mb) { - DbgPrint("PushMenuBar %p\n", mb); + TRACE("PushMenuBar %p\n", mb); mb->AddRef(); @@ -790,7 +817,7 @@ HRESULT CMenuFocusManager::PushMenuBar(CMenuBand * mb) HRESULT CMenuFocusManager::PushMenuPopup(CMenuBand * mb) { - DbgPrint("PushTrackedPopup %p\n", mb); + TRACE("PushTrackedPopup %p\n", mb); mb->AddRef(); @@ -802,6 +829,8 @@ HRESULT CMenuFocusManager::PushMenuPopup(CMenuBand * mb) hr = UpdateFocus(); + m_menuDepth++; + if (m_parent && m_parent->type != TrackedMenuEntry) { m_parent->mb->_SetChildBand(mb); @@ -813,7 +842,7 @@ HRESULT CMenuFocusManager::PushMenuPopup(CMenuBand * mb) 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 @@ HRESULT CMenuFocusManager::PushTrackedPopup(HMENU popup) 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 @@ HRESULT CMenuFocusManager::PopMenuBar(CMenuBand * mb) CMenuBand * mbc; HRESULT hr; - DbgPrint("PopMenuBar %p\n", mb); + TRACE("PopMenuBar %p\n", mb); if (m_current == m_entryUnderMouse) { @@ -880,13 +909,15 @@ HRESULT CMenuFocusManager::PopMenuPopup(CMenuBand * mb) 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 @@ HRESULT CMenuFocusManager::PopTrackedPopup(HMENU popup) HMENU hmenu; HRESULT hr; - DbgPrint("PopTrackedPopup %p\n", popup); + TRACE("PopTrackedPopup %p\n", popup); hr = PopFromArray(&type, NULL, &hmenu); if (FAILED_UNEXPECTEDLY(hr)) diff --git a/reactos/base/shell/rshell/CMenuFocusManager.h b/reactos/base/shell/rshell/CMenuFocusManager.h index 213111b9670..75aa8dea109 100644 --- a/reactos/base/shell/rshell/CMenuFocusManager.h +++ b/reactos/base/shell/rshell/CMenuFocusManager.h @@ -85,6 +85,7 @@ private: #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 @@ private: 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); diff --git a/reactos/base/shell/rshell/CMenuToolbars.cpp b/reactos/base/shell/rshell/CMenuToolbars.cpp index 1efd68ee363..704c626044e 100644 --- a/reactos/base/shell/rshell/CMenuToolbars.cpp +++ b/reactos/base/shell/rshell/CMenuToolbars.cpp @@ -73,9 +73,6 @@ HRESULT CMenuToolbarBase::OnWinEvent(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM //return OnHotItemChange(reinterpret_cast(hdr), theResult); return S_OK; - case NM_RCLICK: - return OnContextMenu(reinterpret_cast(hdr)); - case NM_CUSTOMDRAW: return OnCustomDraw(reinterpret_cast(hdr), theResult); @@ -770,7 +767,7 @@ HRESULT CMenuToolbarBase::TrackContextMenu(IContextMenu* contextMenu, POINT pt) HRESULT CMenuToolbarBase::BeforeCancelPopup() { m_cancelingPopup = TRUE; - DbgPrint("BeforeCancelPopup\n"); + TRACE("BeforeCancelPopup\n"); return S_OK; } @@ -797,13 +794,30 @@ HRESULT CMenuToolbarBase::ProcessClick(INT iItem) TRACE("Executing...\n"); - return m_menuBand->_MenuItemHotTrack(MPOS_EXECUTE); + return m_menuBand->_MenuItemSelect(MPOS_EXECUTE); } -HRESULT CMenuToolbarBase::MenuBarMouseDown(INT iIndex) +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 || m_cancelingPopup) @@ -812,7 +826,6 @@ HRESULT CMenuToolbarBase::MenuBarMouseDown(INT iIndex) return S_OK; } - GetButton(iIndex, &btn); return ProcessClick(btn.idCommand); } @@ -842,17 +855,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) { int prev = m_hotItem; diff --git a/reactos/base/shell/rshell/CMenuToolbars.h b/reactos/base/shell/rshell/CMenuToolbars.h index 2866dbd699a..185dab94159 100644 --- a/reactos/base/shell/rshell/CMenuToolbars.h +++ b/reactos/base/shell/rshell/CMenuToolbars.h @@ -96,9 +96,10 @@ public: 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 @@ private: HRESULT UpdateImageLists(); HRESULT OnPagerCalcSize(LPNMPGCALCSIZE csize); - HRESULT OnContextMenu(NMMOUSE * rclick); HRESULT OnCustomDraw(LPNMTBCUSTOMDRAW cdraw, LRESULT * theResult); HRESULT OnGetInfoTip(NMTBGETINFOTIP * tip); diff --git a/reactos/base/shell/rshell/ShellDDE.cpp b/reactos/base/shell/rshell/ShellDDE.cpp index 0fe765020bb..03d571fc13f 100644 --- a/reactos/base/shell/rshell/ShellDDE.cpp +++ b/reactos/base/shell/rshell/ShellDDE.cpp @@ -56,7 +56,7 @@ static BOOL Dde_OnConnect(HSZ hszTopic, HSZ hszService) 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 @@ static void Dde_OnConnectConfirm(HCONV hconv, HSZ hszTopic, HSZ hszService) 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 @@ static BOOL Dde_OnWildConnect(HSZ hszTopic, HSZ hszService) 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 @@ static HDDEDATA Dde_OnRequest(UINT uFmt, HCONV hconv, HSZ hszTopic, HSZ hszItem) 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 @@ static DWORD Dde_OnExecute(HCONV hconv, HSZ hszTopic, HDDEDATA hdata) 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 @@ static DWORD Dde_OnExecute(HCONV hconv, HSZ hszTopic, HDDEDATA hdata) 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 DWORD Dde_OnExecute(HCONV hconv, HSZ hszTopic, HDDEDATA hdata) 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 @@ static HDDEDATA CALLBACK DdeCallback( 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 @@ static HDDEDATA CALLBACK DdeCallback( */ 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) { diff --git a/reactos/dll/win32/shell32/CDefView.cpp b/reactos/dll/win32/shell32/CDefView.cpp index 1d0264be050..cf179b241b7 100644 --- a/reactos/dll/win32/shell32/CDefView.cpp +++ b/reactos/dll/win32/shell32/CDefView.cpp @@ -1898,14 +1898,14 @@ LRESULT CDefView::OnInitMenuPopup(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL 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 @@ LRESULT CDefView::OnInitMenuPopup(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL 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) { diff --git a/reactos/dll/win32/shell32/CDesktopBrowser.cpp b/reactos/dll/win32/shell32/CDesktopBrowser.cpp index 98fdbdcdf47..250dfb89f1f 100644 --- a/reactos/dll/win32/shell32/CDesktopBrowser.cpp +++ b/reactos/dll/win32/shell32/CDesktopBrowser.cpp @@ -519,7 +519,7 @@ LRESULT CALLBACK CDesktopBrowser::ProgmanWindowProc(IN HWND hwnd, IN UINT uMsg, } case WM_EXPLORER_OPEN_NEW_WINDOW: - DbgPrint("Proxy Desktop message 1035 received.\n"); + TRACE("Proxy Desktop message 1035 received.\n"); SHOnCWMCommandLine((HANDLE)lParam); break; diff --git a/reactos/dll/win32/shell32/dde.cpp b/reactos/dll/win32/shell32/dde.cpp index ba0d37af58c..5037792fdb2 100644 --- a/reactos/dll/win32/shell32/dde.cpp +++ b/reactos/dll/win32/shell32/dde.cpp @@ -55,7 +55,7 @@ static BOOL Dde_OnConnect(HSZ hszTopic, HSZ hszService) 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 @@ static void Dde_OnConnectConfirm(HCONV hconv, HSZ hszTopic, HSZ hszService) 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 @@ static BOOL Dde_OnWildConnect(HSZ hszTopic, HSZ hszService) 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 @@ static HDDEDATA Dde_OnRequest(UINT uFmt, HCONV hconv, HSZ hszTopic, HSZ hszItem) 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 @@ static DWORD Dde_OnExecute(HCONV hconv, HSZ hszTopic, HDDEDATA hdata) 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 @@ static DWORD Dde_OnExecute(HCONV hconv, HSZ hszTopic, HDDEDATA hdata) 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 DWORD Dde_OnExecute(HCONV hconv, HSZ hszTopic, HDDEDATA hdata) 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 @@ static HDDEDATA CALLBACK DdeCallback( 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 @@ static HDDEDATA CALLBACK DdeCallback( */ 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) {