[Mwinapi-commits] SF.net SVN: mwinapi:[95] trunk/ManagedWinapi/Hook.cs
Status: Beta
Brought to you by:
schierlm
From: <sch...@us...> - 2010-11-18 17:12:06
|
Revision: 95 http://mwinapi.svn.sourceforge.net/mwinapi/?rev=95&view=rev Author: schierlm Date: 2010-11-18 17:12:00 +0000 (Thu, 18 Nov 2010) Log Message: ----------- Work around some problems on systems that have only .NET 4.0 installed but no earlier versions. (The MouseHook didn't work with .NET 4.0). More details regarding the cause of the problem: "SetWindowsHookEx works in Net 2 but not in Net 4" <http://social.msdn.microsoft.com/Forums/en/vbgeneral/thread/9bb5e76d-e9a3-4264-a9e9-842e6ff5ac32> [submitted by Peter Ziewer <ziewer at in dot tum dot de>] Modified Paths: -------------- trunk/ManagedWinapi/Hook.cs Modified: trunk/ManagedWinapi/Hook.cs =================================================================== --- trunk/ManagedWinapi/Hook.cs 2010-09-29 16:10:36 UTC (rev 94) +++ trunk/ManagedWinapi/Hook.cs 2010-11-18 17:12:00 UTC (rev 95) @@ -124,7 +124,7 @@ } else if (global) { - hHook = SetWindowsHookEx(type, delegt, Marshal.GetHINSTANCE(typeof(Hook).Assembly.GetModules()[0]), 0); + hHook = SetWindowsHookEx(type, delegt, System.Diagnostics.Process.GetCurrentProcess().MainModule.BaseAddress, 0); } else { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |