Пример #1
0
        public bool UnregisterHotkey(HotkeyInfo hotkeyInfo)
        {
            if (hotkeyInfo != null)
            {
                if (hotkeyInfo.ID > 0)
                {
                    bool result = NativeMethods.UnregisterHotKey(Handle, hotkeyInfo.ID);

                    if (result)
                    {
                        NativeMethods.GlobalDeleteAtom(hotkeyInfo.ID);
                        hotkeyInfo.ID     = 0;
                        hotkeyInfo.Status = HotkeyStatus.NotConfigured;
                        return(true);
                    }
                }

                hotkeyInfo.Status = HotkeyStatus.Failed;
            }

            return(false);
        }
Пример #2
0
 public void Reset()
 {
     EditingHotkey = false;
     HotkeyInfo    = new HotkeyInfo();
     SetDefaultButtonText();
 }
Пример #3
0
 public void UpdateHotkey(HotkeyInfo hotkeyInfo)
 {
     HotkeyInfo = hotkeyInfo;
     UpdateHotkeyText();
 }
Пример #4
0
 private void UpdateHotkeyText()
 {
     Text = HotkeyInfo.ToString();
     Invalidate();
 }