Local Mouse Hook problem

  • Thread starter Thread starter Johnny J.
  • Start date Start date
J

Johnny J.

I want to intercept mouse events in my application and in certain cases
cancel them. I used the code from CodeProject to implement a mouse hook:

http://www.codeproject.com/csharp/netwin32hooks.asp

(the above code is in C#, but my program is in VB! so this is the right
newsgroup, thank you...)

It works perfectly, and I can intercept the mouse events I want. However, it
doesn't seem like there is no way of cancelling the events (or e.g. setting
handled = true).

Has anybody got experience with that?

Cheers,
Johnny J.
 
It works perfectly, and I can intercept the mouse events I want. However, it
doesn't seem like there is no way of cancelling the events (or e.g. setting
handled = true).

Has anybody got experience with that?

You have a WH_MOUSE hook? If so you can skip calling CallNextHookEx
and return nonzero from your hook procedure to prevent the default
message processing, as long as nCode >= 0.


Mattias
 
Tack så mycket Mattias - Det var precis det jag ville veta - nu funkar allt
perfekt.

Vänliga hälsningar,
Johnny¨
 
Back
Top