Exemple #1
0
 internal static extern int SetWindowsHookEx(int idHook, GlobalHook.HookProcCallBack lpfn, IntPtr hInstance, int threadId);
Exemple #2
0
        /// <summary>
        /// Initializes hooks
        /// </summary>
        private void SetUpHooks()
        {
            if (!(Site != null && Site.DesignMode))
            {
                _mouseHook = new GlobalHook(GlobalHook.HookTypes.Mouse);
                _mouseHook.MouseWheel += new MouseEventHandler(_mouseHook_MouseWheel);
                _mouseHook.MouseDown += new MouseEventHandler(_mouseHook_MouseDown);

                _keyboardHook = new GlobalHook(GlobalHook.HookTypes.Keyboard);
                _keyboardHook.KeyDown += new KeyEventHandler(_keyboardHook_KeyDown);
            }
        }