コード例 #1
0
 public void RegisterHotKey()
 {
     if (_key == Key.None)
     {
         return;
     }
     if (_isKeyRegistered)
     {
         UnregisterHotKey();
     }
     _isKeyRegistered = HotKeyWinApi.RegisterHotKey(_handle, _id, _modifiers, KeyInterop.VirtualKeyFromKey(_key));
     if (!_isKeyRegistered)
     {
         throw new ApplicationException("Hotkey already in use");
     }
 }
コード例 #2
0
 public void UnregisterHotKey()
 {
     _isKeyRegistered = !HotKeyWinApi.UnregisterHotKey(_handle, _id);
 }