Beispiel #1
0
        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);
        }
Beispiel #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();
 }
Beispiel #4
0
 internal void Unregister()
 {
     GlobalHotKeyManager.UnregisterGlobalHotKey(this.Id);
 }