private void button1_Click_1(object sender, EventArgs e) { List <string> ProcessNameToCapture = new List <string>(); foreach (object item in checkedListBox1.CheckedItems) { ProcessNameToCapture.Add(item.ToString()); } var phandles = ProcessHelper.getProcessHandlesFromName(ProcessNameToCapture); ProcessHelper.CaptureApplications(phandles, textBox1.Text, textBox2.Text); updateCounter(); }