diff --git a/Bin/SunnyUI.dll b/Bin/SunnyUI.dll index 5511e88b..a3eead5a 100644 Binary files a/Bin/SunnyUI.dll and b/Bin/SunnyUI.dll differ diff --git a/SunnyUI/Units/UHook.cs b/SunnyUI/Units/UHook.cs index f2f8963a..52e59a67 100644 --- a/SunnyUI/Units/UHook.cs +++ b/SunnyUI/Units/UHook.cs @@ -19,9 +19,9 @@ * 2020-01-01: V2.2.0 增加文件说明 ******************************************************************************/ +using Sunny.UI.Win32; using System; using System.Drawing; -using System.Reflection; using System.Runtime.InteropServices; using System.Windows.Forms; @@ -185,8 +185,8 @@ namespace Sunny.UI // If not, GC randomly collects it, and a NullReference exception is thrown _hookCallback = HookCallbackProcedure; - _handleToHook = SetWindowsHookEx(_hookType, _hookCallback, - Marshal.GetHINSTANCE(Assembly.GetExecutingAssembly().GetModules()[0]), 0); + _handleToHook = SetWindowsHookEx(_hookType, _hookCallback, (IntPtr)Kernel.GetModuleHandle(null), 0); + //Marshal.GetHINSTANCE(Assembly.GetExecutingAssembly().GetModules()[0]), 0); // Were we able to sucessfully start hook? if (_handleToHook != 0)