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.");
            }
        }
Exemple #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);
            }
        }
 private void UnregisterHotKey()
 {
     isKeyRegistered = !HotKeyWinApi.UnregisterHotKey(handle, id);
 }