Exemplo n.º 1
0
 public PrimaryHook(IInputHook targetHook)
 {
     _hookProcedureFunction = HookProcedure; // So the garbage collector does not free the procedure.
     _targetHook            = targetHook;
     Env.App.Run           += Register;
     Env.App.Exiting       += _targetHook.Reset;
     Env.App.Unhook        += () =>
     {
         _hookHandle?.Dispose();
         _mouseHookHandle?.Dispose();
     };
 }
Exemplo n.º 2
0
 public static extern HookHandle SetWindowsHookEx(HookType hookType, HookProcedureFunction procedure, IntPtr dllHandle, int threadId);