diff --git a/base/shell/rshell/CMenuBand.cpp b/base/shell/rshell/CMenuBand.cpp index 75142556a91..127ef22bcb4 100644 --- a/base/shell/rshell/CMenuBand.cpp +++ b/base/shell/rshell/CMenuBand.cpp @@ -868,6 +868,10 @@ HRESULT CMenuBand::_MenuItemHotTrack(DWORD changeType) switch (changeType) { + case MPOS_EXECUTE: + m_hotBar->ExecuteItem(m_hotItem); + break; + case MPOS_SELECTLEFT: if (m_parentBand && m_parentBand->_IsPopup()==S_FALSE) return m_parentBand->_MenuItemHotTrack(VK_LEFT); diff --git a/base/shell/rshell/CMenuFocusManager.cpp b/base/shell/rshell/CMenuFocusManager.cpp index 1ed206944ba..33246f3bc48 100644 --- a/base/shell/rshell/CMenuFocusManager.cpp +++ b/base/shell/rshell/CMenuFocusManager.cpp @@ -442,6 +442,9 @@ LRESULT CMenuFocusManager::GetMsgHook(INT nCode, WPARAM hookWParam, LPARAM hookL case VK_RMENU: m_current->mb->_MenuItemHotTrack(MPOS_FULLCANCEL); break; + case VK_RETURN: + m_current->mb->_MenuItemHotTrack(MPOS_EXECUTE); + break; case VK_LEFT: m_current->mb->_MenuItemHotTrack(VK_LEFT); break; @@ -455,6 +458,9 @@ LRESULT CMenuFocusManager::GetMsgHook(INT nCode, WPARAM hookWParam, LPARAM hookL m_current->mb->_MenuItemHotTrack(VK_DOWN); break; } + msg->message = WM_NULL; + msg->lParam = 0; + msg->wParam = 0; } break; } diff --git a/base/shell/rshell/CMenuToolbars.cpp b/base/shell/rshell/CMenuToolbars.cpp index f6c90af4bd5..6159b310ba2 100644 --- a/base/shell/rshell/CMenuToolbars.cpp +++ b/base/shell/rshell/CMenuToolbars.cpp @@ -814,9 +814,16 @@ HRESULT CMenuToolbarBase::OnCommand(WPARAM wParam, LPARAM lParam, LRESULT *theRe *theResult = 0; + INT iItem = (INT)wParam; + + return ExecuteItem(iItem); +} + +HRESULT CMenuToolbarBase::ExecuteItem(INT iItem) +{ m_menuBand->_KillPopupTimers(); - if (PopupItem(wParam) == S_OK) + if (PopupItem(iItem) == S_OK) { TRACE("PopupItem returned S_OK\n"); return S_FALSE; @@ -829,7 +836,6 @@ HRESULT CMenuToolbarBase::OnCommand(WPARAM wParam, LPARAM lParam, LRESULT *theRe if (FAILED_UNEXPECTEDLY(hr)) return hr; - INT iItem = wParam; INT index; DWORD_PTR data; diff --git a/base/shell/rshell/CMenuToolbars.h b/base/shell/rshell/CMenuToolbars.h index 65b132b24ce..8d7a7cce2dc 100644 --- a/base/shell/rshell/CMenuToolbars.h +++ b/base/shell/rshell/CMenuToolbars.h @@ -77,6 +77,8 @@ public: HRESULT KeyboardItemChange(DWORD changeType); + HRESULT ExecuteItem(INT iItem); + HRESULT IsTrackedItem(INT index); HRESULT ChangeTrackedItem(INT index, BOOL wasTracking, BOOL mouse);