public void UnregisterAllHotkeys() { for (int i = this._currentId; i > 0; i--) { HotkeyHook.UnregisterHotKey(this._window.Handle, i); } this._currentId = 0; }
public void RegisterHotKey(ModifierKeys modifier, Keys key) { this._currentId++; if (!HotkeyHook.RegisterHotKey(this._window.Handle, this._currentId, (uint)modifier, (uint)key)) { throw new InvalidOperationException("Couldn’t register the hot key."); } }
static HotkeyHook() { Instance = new HotkeyHook(); }
static HotkeyHook() { Instance = new HotkeyHook(); }