NullReferenceException when call CallNextHookEx in multi-Thread app
SetWindowsHookEx(WH_MOUSE_LL, mousehookDelegate, intptr, 0)
在这里用了一个实例代理没有用匿名,
HookProc mousehookDelegate = new HookProc(MouseHookProc);
SetWindowsHookEx(WH_MOUSE_LL, MouseHookProc , intptr, 0);
然后在Control.Invoke() 调用。
貌似运行了好一会也没有碰到异常了