How to use mouse hook so current window never sees specific mouse message?
I want some win开发者_开发知识库dow to never receive mouse wheel up/downs, i can control this messages trough my mouse hook fine but is there a way to make a window never receive those messages?
I can validate the window trough mouse hook and check if its active then just never send that message to it.
I installed mouse hook globally so i believe i have everything needed.
AFAIK hooks may not block the message from reaching the wndproc of the appropriate window.
You may however achieve what you need by subclassing the appropriate windows. That is, replace the window procedure of the appropriate window (use SetWindowLongPtr
with GWL_WNDPROC
flag) by your wndproc. It should pass all the messages to the original wndproc, apart from those that you want to filter-out.
精彩评论