I\'ve been working on this one quite a bit and haven\'t gotten any closer to a solution.
I juut dug up my old copy of the WindowsHookLib again - It\'s available with
I found when migrating to .NET 4.0 I had to send in IntPtr.Zero for the hMod parameter when the Hook Procedure was in the local assembly. You can refer to the msdn documentation here.
http://msdn.microsoft.com/en-us/library/ms644990%28VS.85%29.aspx
I am also having this problem. I found that it seems to be to do with the version of .Net you are using. .Net 4 you get this error, change to .Net 3.5 and it works.