[Mono-list] Low level mouse hook via SetWindowsHookEx

Robert Jordan robertj at gmx.net
Sun Jul 5 06:12:51 EDT 2009

Jonathan Pryor wrote:
> For the love of $deity, you shouldn't do this on Windows either.
> The problem is that hooks involve inserting your DLL into every  
> process' address space, which will thus require loading the CLR.  
> However, until .NET 4.0 (unreleased), only one version of the CLR can  
> be loaded. Result: you may try loading your assembly into a process  
> which has only .NET 1.x loaded, resulting in a TypeLoadException.
> This is, of course, bad. It's also why you don't currently see many  
> Explorer shell extensions written on managed code.
> Please don't do that.

Global WM_MOUSE_LL hooks are not critical because they don't inject
code into the address space of other processes. And other global
hooks won't work w/out the help of an unmanaged DLL anyways.


More information about the Mono-list mailing list