Need to disable mouse right click in Windows?
Question
I am creating a system tray app which monitors mouse clicks in Windows. I want to disable the right mouse click. My app is based on this sample code.
In the HookCallback method, I tried to do this:
if ((MouseMessages)wParam == MouseMessages.WM_RBUTTONDOWN)
return (System.IntPtr)1;
thinking the mpuse event will be not be processed but the context menu of the right mouse click still shows up.
Solution 2
I used Mini-Input from www.mini-tools.com.
OTHER TIPS
I think you have not handled WM_RBUTTONUP message, that's why the context menu showes up.
Just add this code snippet and check it works...
if ((MouseMessages)wParam == MouseMessages.WM_RBUTTONUP)
return (System.IntPtr)1;
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow