Groups | Blog | Home
all groups > dotnet framework > september 2007 >

dotnet framework : Global CBT Hooking


Yehia A.Salam
9/30/2007 4:06:41 PM
Hello,

I'm developing an application which relies heavily on global hooks and
apparently C# does not support this type of hooking. What I have in mind is
to make a dll (in Delphi) that handle all the hooking and call a user
defined c# function for further handling, is this possible, could I link the
dll function with the C# function without any complication?

I considered moving the whole project to Delphi, the Visual Sudio IDE was
the only thing keeping me from doing so. Should I use C# for this type of
project or should I consider other alternatives, as hooking in Delphi is
straightforward.

Thanks
Yehia A.Salam
Mattias Sjögren
9/30/2007 5:59:24 PM
[quoted text, click to view]

You have to keep in mind that the hook procedure will be loaded and
called in different threads and processes depending on where the event
occurs. So you can't make a simple call to the C# code, it will
require some kind of interprocess communication mechanism.


Mattias

--
Mattias Sjögren [C# MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
AddThis Social Bookmark Button