SetWindowsHookEx失败
使用下面代码hook鼠标
res = SetWindowsHookEx(WH_MOUSE_LL, _mouseHookProcedure, Marshal.GetHINSTANCE(System.Reflection.Assembly.GetExecutingAssembly().GetModules()[0]), 0);
结果res = 0 ,使用 GetLastError()获得返回值=126 (找不到指定的模块)
解决方法,用下面语句替换
var mar = LoadLibraryW("user32.dll"); res = SetWindowsHookEx(WH_MOUSE_LL, _mouseHookProcedure, mar, 0);