/// <summary> /// Registers a hot key in the system. /// </summary> /// <param name="modifier">The modifiers that are associated with the hot key.</param> /// <param name="key">The key itself that is associated with the hot key.</param> public void RegisterHotKey(Hotkey hotkey) { // increment the counter. _currentId = _currentId + 1; // register the hot key. if (!RegisterHotKey(_window.Handle, _currentId, (uint)ModifierKeys.Shift | (uint)ModifierKeys.Control, hotkey.GetKeyUInt())) { //if (!RegisterHotKey(_window.Handle, _currentId, hotkey.GetModifiersUInt(), hotkey.GetKeyUInt())) //(uint)key throw new InvalidOperationException("Couldn’t register the hot key."); } }