private void getPrecess() { process = Process.GetProcesses(); processItems.Clear(); foreach (var item in process) { processItems.Add(new ProcessItem(item)); } gcProcess.DataSource = processItems; windows = GetProcesses.GetAllWindows(); gcRun.DataSource = windows; }
private void Form1_Load(object sender, EventArgs e) { getPrecess(); timer1.Enabled = true; timer1.Interval = 3000; int ff = 0; List <string> FileNames = new List <string>(); foreach (var wnd in GetProcesses.GetAllWindows()) { GetProcesses.GetWindowThreadProcessId(wnd.handle, out ff); FileNames.Add(Process.GetProcessById(ff).MainModule.ModuleName); } }