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."); } }
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); }