【发布时间】:2014-06-05 15:00:35
【问题描述】:
当我运行 Windows rask 管理器时,我看到许多进程/应用程序。 但在我的程序中,我只看到 9 个。
void PopulateApplications()
{
dataGridView1.Rows.Clear();
foreach (Process p in Process.GetProcesses())
{
if (p.MainWindowTitle.Length > 1)
{
var icon = Icon.ExtractAssociatedIcon(p.MainModule.FileName);
ima = icon.ToBitmap();
ima = resizeImage(ima, new Size(25, 25));
ima.Save(@"c:\temp\ima.jpg");
String status = p.Responding ? "Running" : "Not Responding";
dataGridView1.Rows.Add(ima,p.ProcessName, status);
DoubleBuffered1(dataGridView1, true);
}
}
firsttime += 1;
if (firsttime == 1)
{
NumberOfRows = dataGridView1.Rows.Count;
}
if (NumberOfRows != dataGridView1.Rows.Count)
{
int diff = dataGridView1.Rows.Count - NumberOfRows;
this.Height = this.Height + (ROW_SIZE * diff);
NumberOfRows = dataGridView1.Rows.Count;
}
}
我遍历进程并为每个进程添加一行,它是图标。 但我在 dataGridView1 中只看到 9 个进程。
如何像在任务管理器中一样将所有进程/应用程序添加到 dataGridView1 行? 我如何才能找到系统一直在运行的那些我无法关闭但正在运行的进程列表?
【问题讨论】: