Пример #1
0
        private void RegisterHotKey()
        {
            if (Key == Key.None)
            {
                return;
            }

            UnregisterHotKey();

            isKeyRegistered = HotKeyWinApi.RegisterHotKey(handle, id, ModifierKey, (uint)KeyInterop.VirtualKeyFromKey(Key));
            if (!isKeyRegistered)
            {
                throw new ApplicationException("Hotkey already in use.");
            }
        }
Пример #2
0
        private void RegisterHotKey()
        {
            if (Key == Key.None)
            {
                return;
            }

            UnregisterHotKey();

            isKeyRegistered = HotKeyWinApi.RegisterHotKey(handle, id, ModifierKey, (uint)KeyInterop.VirtualKeyFromKey(Key));
            if (!isKeyRegistered)
            {
                throw new ApplicationException(Mmfm.Properties.Resources.HoKey_InUse);
            }
        }
Пример #3
0
 private void UnregisterHotKey()
 {
     isKeyRegistered = !HotKeyWinApi.UnregisterHotKey(handle, id);
 }