这个问题问了很多次了,搜索先!在Delphi猛料包里面也有!

解决方案 »

  1.   

    给你一个例子:
    先在Form上放一个ListView控件,将ListView的ViewStyle属性值改为vsReport,然后双击ListView,增加两个Column,将Column的width的值设置为200.
    然后加一个Button按钮.记得在uses里加入tlhelp32单元.(
    其实这些你搜索一下以前的帖子再自己动动手就会了的)在Button的单击事件里:
    procedure TForm1.Button1Click(Sender: TObject);
    var
       Han: THandle;
       Process: PROCESSENTRY32;
       ok: boolean;
       Rec: TListItem;
       i:integer;begin              //取得系统进程
                 ListView1.Items.Clear;
                 i := 0;
                 Han := CreateToolhelp32Snapshot(TH32CS_SNAPALL, 0);
                 Process.dwSize := SizeOf(Process);
                 ok := Process32First(Han, Process);
                 while ok do
                    begin
                       Rec := ListView1.Items.Add;
                       Rec.Caption := IntToStr(i);
                       Rec.Caption:=Process.szExeFile ;
                       Rec.SubItems.Add(IntToStr(Process.th32ProcessID));
                       i := i+1;
                       ok := Process32Next(Han,Process);
                    end;
             end;