diff --git a/Src/DirView.cpp b/Src/DirView.cpp index fca01410f00..3581de4e434 100644 --- a/Src/DirView.cpp +++ b/Src/DirView.cpp @@ -49,6 +49,7 @@ #include "SyntaxColors.h" #include "Shell.h" #include "DirTravel.h" +#include "MouseHook.h" #include #include @@ -638,6 +639,8 @@ void CDirView::Redisplay() */ void CDirView::OnContextMenu(CWnd*, CPoint point) { + if (CMouseHook::IsRightWheelScrolling()) + return; if (GetListCtrl().GetItemCount() == 0) return; // Make sure window is active diff --git a/Src/MergeEditView.cpp b/Src/MergeEditView.cpp index e231e3b5794..9e42026cec9 100644 --- a/Src/MergeEditView.cpp +++ b/Src/MergeEditView.cpp @@ -33,6 +33,7 @@ #include "Shell.h" #include "SelectPluginDlg.h" #include "Constants.h" +#include "MouseHook.h" #ifdef _DEBUG #define new DEBUG_NEW @@ -2870,6 +2871,9 @@ void CMergeEditView::OnUpdateEditReplace(CCmdUI* pCmdUI) */ void CMergeEditView::OnContextMenu(CWnd* pWnd, CPoint point) { + if (CMouseHook::IsRightWheelScrolling()) + return; + CRect rect; GetClientRect(rect); ClientToScreen(rect); diff --git a/Src/MouseHook.cpp b/Src/MouseHook.cpp index dc42ddc138d..ef0fef8ca8d 100644 --- a/Src/MouseHook.cpp +++ b/Src/MouseHook.cpp @@ -1,5 +1,6 @@ #include #include "MouseHook.h" +#include BOOL CMouseHook::PreTranslateMessage(MSG* pMsg) { @@ -77,14 +78,14 @@ BOOL CMouseHook::PreTranslateMessage(MSG* pMsg) if (zDelta > 0) { // RButton+ScrollUp as Alt+Up - m_bIgnoreRBUp = true; + StartRightWheelScrolling(); PostMessage(hwndTarget, WM_COMMAND, ID_PREVDIFF, 0); return TRUE; } else if (zDelta < 0) { // RButton+ScrollDown as Alt+Down - m_bIgnoreRBUp = true; + StartRightWheelScrolling(); PostMessage(hwndTarget, WM_COMMAND, ID_NEXTDIFF, 0); return TRUE; } @@ -139,14 +140,14 @@ BOOL CMouseHook::PreTranslateMessage(MSG* pMsg) if (zDelta > 0) { // RButton+ScrollRight as Alt+Right - m_bIgnoreRBUp = true; + StartRightWheelScrolling(); PostMessage(hwndTarget, WM_COMMAND, ID_L2R, 0); return TRUE; } else if (zDelta < 0) { // RButton+ScrollLeft as Alt+Left - m_bIgnoreRBUp = true; + StartRightWheelScrolling(); PostMessage(hwndTarget, WM_COMMAND, ID_R2L, 0); return TRUE; }