Exemple #1
0
        private void RegisterHotKey()
        {
            if (Key == Key.None)
            {
                return;
            }

            if (_isKeyRegistered)
            {
                UnregisterHotKey();
            }

            _isKeyRegistered = HotKeyWinApi.RegisterHotKey(_handle, _id, KeyModifier, InteropKey);

            if (!_isKeyRegistered)
            {
                throw new ApplicationException(Properties.strings.hotkeyInUse);
            }
        }
Exemple #2
0
 private void UnregisterHotKey()
 {
     _isKeyRegistered = !HotKeyWinApi.UnregisterHotKey(_handle, _id);
 }