如何使用鼠标挂钩禁用鼠标右键单击事件,如剪切,复制,删除,粘贴和重命名
问题描述:
您好,
如何使用VC ++或C ++处理剪贴板鼠标事件,如剪切,复制,粘贴,删除和重命名。
我使用键盘钩子成功完成了这些事件。我使用了虚拟键VK_CONTROL,VK_DELETE等。
所以我有陷阱这些事件并停止执行此事件。所以我可以用同样的方式为鼠标做同样的事情。任何人都可以指导我这样做。我感觉很难找到复制,剪切,粘贴,删除事件鼠标右键单击(使用鼠标挂钩)。
先谢谢
Hello,
How to work with clipboard mouse events like cut, copy, paste, delete and rename using VC++ or C++.
I was succesfull in performing these events using keyboard hooks.I have used virtual keys VK_CONTROL,VK_DELETE etc..
So i have trapped these events and stoped performing this events.So in the same way how can i do the same thing for the mouse.Can any one guide me to do this.I am feeling difficulty in finding the Copy,cut,paste,delete events from mouse right click(Using Mouse Hooks).
Thanks in Advance
答
检查挂钩功能。 ..
http: //msdn.microsoft.com/en-us/library/windows/desktop/ms644990%28v=vs.85%29.aspx [ ^ ]
注意:第四个参数应为0以使钩子全局化
和
http://msdn.microsoft。 com / zh-CN / library / windows / desktop / ms644986%28v = vs.85%29.aspx [ ^ ]
另外有一篇关于codeproject本身的优秀文章...
您的桌面和Microsoft的SetWindowsHookEx() [ ^ ]
Check the hook functions...
http://msdn.microsoft.com/en-us/library/windows/desktop/ms644990%28v=vs.85%29.aspx[^]
Note : Fourth parameter should be 0 to make the hook global
and
http://msdn.microsoft.com/en-us/library/windows/desktop/ms644986%28v=vs.85%29.aspx[^]
Also there is an excellent article on codeproject itself...
Your Desktop and Microsoft''s SetWindowsHookEx()[^]