Beispiel #1
0
        private void window_event_triggered(uint pid)
        {
            if (IsDisposed || !this.IsHandleCreated)
            {
                return;
            }

            this.BeginInvoke(new MethodInvoker(() =>
            {
                pid = WinEventHelper.GetForegroundWindowThreadProcessId();
                SetProcessButtonActiveByProcessId(pid);
            }));
        }
Beispiel #2
0
        private void process_button_removed(object sender, ControlEventArgs e)
        {
            if (IsDisposed || !this.IsHandleCreated)
            {
                return;
            }

            if (_buttonsContainer.Controls.Count != 0)
            {
                var pid = WinEventHelper.GetForegroundWindowThreadProcessId();
                //Console.WriteLine(pid);
                this.BeginInvoke(new MethodInvoker(() =>
                {
                    SetProcessButtonActiveByProcessId(pid);
                }));
            }
        }