예제 #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("An unexpected Error occured! (Hotkey may already be in use)");
            }
        }
예제 #2
0
 private void UnregisterHotKey()
 {
     _isKeyRegistered = !HotKeyWinApi.UnregisterHotKey(_handle, _id);
 }