示例#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
文件: HotKey.cs 项目: msmcjp/mmfm
        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);
            }
        }