public void Clear()
 {
     foreach (ushort id in this.HotKeyTable.Keys)
     {
         HotKeyManager.UnregisterHotKey(this.Owner.Handle, id);
         GlobalAtom.Delete(id);
     }
     this.HotKeyTable.Clear();
 }
        public bool Register(ModifierKeys modifierKey, Keys key, HotKeyEventHandler hotKeyEventHandler)
        {
            ushort id = GlobalAtom.Add(this.GetHotKeyName(modifierKey, key));

            if (HotKeyManager.RegisterHotKey(this.Owner.Handle, id, (uint)modifierKey, (uint)key))
            {
                this.HotKeyTable.Add(id, hotKeyEventHandler);
                return(true);
            }
            else
            {
                return(false);
            }
        }
        public bool Unregister(ModifierKeys modifierKey, Keys key)
        {
            ushort id = GlobalAtom.Find(this.GetHotKeyName(modifierKey, key));

            if (this.HotKeyTable.ContainsKey(id))
            {
                if (HotKeyManager.UnregisterHotKey(this.Owner.Handle, id))
                {
                    this.HotKeyTable.Remove(id);
                    GlobalAtom.Delete(id);
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            else
            {
                return(false);
            }
        }