Exemple #1
0
 public void UnregisterAllHotkeys()
 {
     for (int i = this._currentId; i > 0; i--)
     {
         HotkeyHook.UnregisterHotKey(this._window.Handle, i);
     }
     this._currentId = 0;
 }
Exemple #2
0
        public void RegisterHotKey(ModifierKeys modifier, Keys key)
        {
            this._currentId++;

            if (!HotkeyHook.RegisterHotKey(this._window.Handle, this._currentId, (uint)modifier, (uint)key))
            {
                throw new InvalidOperationException("Couldn’t register the hot key.");
            }
        }
Exemple #3
0
 static HotkeyHook()
 {
     Instance = new HotkeyHook();
 }
Exemple #4
0
 static HotkeyHook()
 {
     Instance = new HotkeyHook();
 }