Example #1
0
 public void RegisterHotKey()
 {
     if (Key == 0)
     {
         return;
     }
     if (_isKeyRegistered)
     {
         UnregisterHotKey();
     }
     _isKeyRegistered = HotKeyWinApi.RegisterHotKey(_handle, _id, (uint)KeyModifier | MOD_NOREPEAT, Key);
     if (!_isKeyRegistered)
     {
         throw new ApplicationException("Hotkey already in use");
     }
 }
Example #2
0
 public void UnregisterHotKey()
 {
     _isKeyRegistered = !HotKeyWinApi.UnregisterHotKey(_handle, _id);
 }