private void rescan() { PSWindows ps = new PSWindows(); if (!ps.scan()) { MessageBox.Show("There was an error scanning the processes.", "Scan processes", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { lvProcessWindows.Groups.Clear(); lvProcessWindows.BeginUpdate(); foreach (string key in ps.mProcesses.Keys) { if (mExistingProcesses.ContainsKey(key)) { continue; } ListViewGroup grp = lvProcessWindows.Groups.Add(key, key); grp.Tag = ps.mProcesses[key]; } lvProcessWindows.EndUpdate(); } }