public void RegisterHotKeys() { try { KeysConverter kc = new KeysConverter(); if (this.closeLastHotKey == null) { this.closeLastKeyCombo = (Keys)kc.ConvertFromString(Properties.Settings.Default.KeyboardShortcutCloseLast); this.closeLastHotKey = new HotKeyManager(this.wpr.Handle, this.closeLastKeyCombo); this.closeLastHotKey.Register(); } if (this.closeAllHotKey == null) { this.closeAllKeyCombo = (Keys)kc.ConvertFromString(Properties.Settings.Default.KeyboardShortcutCloseAll); this.closeAllHotKey = new HotKeyManager(this.wpr.Handle, this.closeAllKeyCombo); this.closeAllHotKey.Register(); } } catch { } }
public void UnregisterHotKeys() { if (this.closeLastHotKey != null) { this.closeLastHotKey.Dispose(); this.closeLastHotKey = null; } if (this.closeAllHotKey != null) { this.closeAllHotKey.Dispose(); this.closeAllHotKey = null; } }