private void LisBox_Program_SelectedIndexChanged(object sender, EventArgs e)
        {
            LisBox_Window.Items.Clear();

            if (TargetWindow != null)
            {
                TargetWindow.NoInactive = false;
            }
            TargetWindow = null;

            if (LisBox_Program.SelectedIndex == -1)
            {
                TargetApp = null;
                return;
            }

            TargetApp     = ListOfApps[LisBox_Program.Items[LisBox_Program.SelectedIndex].ToString()];
            ListOfWindows = new Dictionary <string, WindowHandleInfo>();
            WindowHandleInfo MainWindow = new WindowHandleInfo(TargetApp.MainWindowHandle);


            ListOfWindows.Add($"{MainWindow.WindowsName}:{MainWindow.Handle}", MainWindow);
            LisBox_Window.Items.Add(ListOfWindows.Last().Key);

            foreach (WindowHandleInfo Window in MainWindow.GetAllChildWindowInfos())
            {
                ListOfWindows.Add($"{Window.WindowsName}:{Window.Handle}", Window);
                LisBox_Window.Items.Add(ListOfWindows.Last().Key);
            }

            timer1.Enabled = true;
        }
        private void LisBox_Window_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (LisBox_Window.SelectedIndex == -1)
            {
                if (TargetWindow != null)
                {
                    TargetWindow.NoInactive = false;
                }
                TargetWindow = null;
                return;
            }

            TargetWindow = ListOfWindows[LisBox_Window.Items[LisBox_Window.SelectedIndex].ToString()];
        }
        public WindowCaptureForm()
        {
            InitializeComponent();
            MouseWheel          += OnMouseWheel;
            TexBox_OnOffKey.Text = OnOffKey.ToString();

            WindowInfo = new WindowHandleInfo(Handle);

            OldSize     = this.Size;
            OldLocation = this.Location;

            foreach (Process App in Process.GetProcesses().Where(P => P.MainWindowHandle != IntPtr.Zero && P.ProcessName != "GameWindowOver"))
            {
                ListOfApps.Add($"{App.ProcessName}:{App.Id}", App);
                LisBox_Program.Items.Add(ListOfApps.Last().Key);
            }

            timer1.Enabled = true;
        }