Got stuck thinking in an idea that i got
<p>First of all, sorry that I was unable to give a proper title.
I got stuck with an idea that's been with me today almost the whole day after searching and searching and searching, till it came to a point that I decided to ask it on Stackoverflow!</p>

<p>So here's where I am stuck:</p>

<p>(I am making an auto-installer currently coded in C# and it is Dutch. It works really awesome but I just need one thing to finish my base. For example:</p>

<ul>
<li>You have 'multiple' objects selected in a checklistbox, those are read from the checklistbox itself, they get trimmed and they get launched after that.</li>
</ul>

<p>Now that's all working, I wanted to add a waiting method, for example we got:</p>

<ul>
<li>Malwarebytes &amp; CCleaner as installation 'example'.</li>
</ul>

<p>Now when both are checked, and I click start, it starts both of the programs.
What I want to do is: to tell the program to start one program, do your thing, once its finished (closed) it should go to the next.</p>

<p>But... There is a problem, my programs are started in an array, so it basically works if there are multiple objects checked, than it will start all of the checked objects. And I really have no idea how to reach the same thing which is basically :</p>

<ul>
<li>If there are multiple objects selected, start the object(s), do your thing(auto-clicking etc.),once its closed and confirmed its closed, move on to the next object and do the same thing until its been completed. I would like to make it work with a progressbar, but never really looked into a progress bar as they seem confusing.</li>
</ul>

<p>I have a piece of code that finds the Process ID so maybe I can do something with that, but the Process ID is never the same on the applications that I start, so when they start in an array I got kinda of an issue.</p>

<p>Could someone help me please figuring out what &amp; how to code / do this?</p>

<p>here's the code i use to make this work :</p>

<pre><code>                string pad = Application.StartupPath;

            foreach (string checkedItem in checkedListBox1.CheckedItems)
            {
                if (checkedItem.Contains("."))
                {
                    string str = checkedItem;
                    if (str.Contains("."))
                    {
                        int index = str.IndexOf('.');
                        string folder = str.Substring(0, index);
                        try
                        {
                            bool started = false;
                            var process = new Process();
                            process.StartInfo.FileName = pad + "/data/" + folder + "/" + checkedItem;
                            started = process.Start();
                            var processID = process.Id;
                            var processNAAM = process.ProcessName;
                            textBox1.Text += "Gevonden - ID: " + processID + "     NAAM: " + processNAAM + Environment.NewLine;
                            textBox1.Text += DateTime.Now.ToString("HH:mm:ss", System.Globalization.DateTimeFormatInfo.InvariantInfo) + "  -  " + "Installatie Keuze wordt opgestart." + Environment.NewLine;
                            process.WaitForExit();

                        }
                        catch (Exception)
                        {
                        }
                    }
                }
            }
</code></pre>
