*UIHook:修改鼠标、键盘钩子
This commit is contained in:
parent
c96db8d21e
commit
0f1092ca14
BIN
Bin/SunnyUI.dll
BIN
Bin/SunnyUI.dll
Binary file not shown.
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user