public List <ProcessInfo> UpdateProcess(string filter) { Process[] ps = Process.GetProcesses(); List <ProcessInfo> list = new List <ProcessInfo>(); DmPlugin dm = SoftContext.DmSystem.Dm; foreach (var p in ps) { int hwnd = dm.FindWindowByProcessId(p.Id, "", ""); string title = dm.GetWindowTitle(dm.GetWindow(hwnd, 7)); list.Add(new ProcessInfo(p, title)); } if (filter == null || filter == "") { return(list); } return(list.Where(x => x.Process.ProcessName.Contains(filter)).ToList()); }