private void InitializeFormHandlers()
        {
            if (this.FormState == FormInitState.Initialized)
            {
                return;
            }

            this.FormState = FormInitState.Initializing;
            GlobalHotKeyManager.RegisterAll(this.Handle);
            this.FormClosing += this.Form1_FormClosing;
            this.hiddenWindows.SelectedIndexChanged += (s, e) => this.Invoke(() => this.show.Enabled = this.hiddenWindows.SelectedItems.Count != 0);
            this.HiddenWindowsChanged += this.OnHiddenWindowsChanged;
            this.VisibleChanged       += (s, e) => this.Invoke(() => this.notifyIcon.Visible = !this.Visible);
        }
Exemple #2
0
        internal bool Register()
        {
            //if (this.HotKey == Keys.None)
            if (this.IsEmpty)
            {
                return(false);
            }

            if (this.Id != 0)
            {
                this.Unregister();
            }

            this.Id = GlobalHotKeyManager.RegisterGlobalHotKey(this.Id, this.ModifierKeys, this.Key);
            return(this.Id != 0);
        }
 internal static void RegisterAll(IntPtr mainFormHandle)
 {
     GlobalHotKeyManager.mainFormHandle = mainFormHandle;
     GlobalHotKeyManager.RegisterAll();
 }
Exemple #4
0
 internal void Unregister()
 {
     GlobalHotKeyManager.UnregisterGlobalHotKey(this.Id);
 }