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);
标签:res,LL,SetWindowsHookEx,WH,mouseHookProcedure,失败,MOUSE 来源: https://www.cnblogs.com/code1992/p/11510740.html