Home All Groups Group Topic Archive Search About
Author
20 Jan 2006 10:12 AM
bruno
In a VB.NET 2005 program, that hooks Kb and mouse inputs for any active
desktop application, I've just added a new CBT hook. After that every think
work fine, like before, BUT:
CBT filter is not actiated, even if SetWindowsHookEx returns a valid hHook 
and UnhookWindowsHookEx returns False. Also in VS output window I get a
message saying "A first chance exception of type 'System.Exception' occurred
in cHOOK.dll" I suppose is related to my problem.
I've checked the code and every think seams to be correct. Can any body give
some suggestions?
Thanks.
Roman

Author
20 Jan 2006 4:49 PM
Mattias Sjögren
>I've checked the code and every think seams to be correct. Can any body give
>some suggestions?

You can't implement global hooks in managed code (except the low-level
mouse and keyboard hooks which are special cases that don't require
injection of code in other processes). C is a better language for
that.


Mattias

--
Mattias Sjögren [C# MVP]  mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.