private static void CallEvent(EventHandler <MouseCaptureEventArgs> eh, MouseCaptureEventArgs ev) { if (eh != null) { eh(null, ev); } }
static MouseCapture() { s_hook = SetWindowsHookEx(WH_MOUSE_LL, s_proc = new LowLevelMouseProc(HookProc), System.Runtime.InteropServices.Marshal.GetHINSTANCE(typeof(MouseCapture).Module), //GetModuleHandle(null), 0); s_eventArgs = new MouseCaptureEventArgs(); AppDomain.CurrentDomain.DomainUnload += delegate { if (s_hook != IntPtr.Zero) { UnhookWindowsHookEx(s_hook); } }; }
private static void CallEvent(EventHandler<MouseCaptureEventArgs> eh, MouseCaptureEventArgs ev) { if (eh != null) eh(null, ev); }
static MouseCapture() { s_hook = SetWindowsHookEx(WH_MOUSE_LL, s_proc = new LowLevelMouseProc(HookProc), System.Runtime.InteropServices.Marshal.GetHINSTANCE(typeof(MouseCapture).Module), //GetModuleHandle(null), 0); s_eventArgs = new MouseCaptureEventArgs(); AppDomain.CurrentDomain.DomainUnload += delegate { if (s_hook != IntPtr.Zero) UnhookWindowsHookEx(s_hook); }; }