请问在线高手们,如何获得各个运行进程的id,并列出来,用哪个函数,我高分相送

解决方案 »

  1.   

    上网不会搜索,就相当于,当兵不会开枪~~话已经说了~~看来不搜给你看看,还得不到你的分~~为了七个猩猩的目标~~努力吧~~第一关键字:“运行 当前 进程 ID Delphi 获得”
      

  2.   

    搜索得一连接~~
    http://jp.njuct.edu.cn/crystal/uploadtools/DELPHI_skills.htm
      

  3.   

    ◇[DELPHI]列举当前系统运行进程
    uses TLHelp32;
    procedure TForm1.Button1Click(Sender: TObject);
    var lppe: TProcessEntry32;
    found : boolean;
    Hand : THandle;
    begin
    Hand := CreateToolhelp32Snapshot(TH32CS_SNAPALL,0);
    found := Process32First(Hand,lppe);
    while found do
    begin
    ListBox1.Items.Add(StrPas(lppe.szExeFile));
    found := Process32Next(Hand,lppe);
    end;
    end;
      

  4.   

    zswang(伴水)(现在是专家门诊清洁工) 你怎么又回来了。好久不见你,红星闪闪。
      

  5.   

    取得系统运行的进程名
    var hCurrentWindow:HWnd;szText:array[0..254] of char;
    begin
    hCurrentWindow:=Getwindow(handle,GW_HWndFrist);
    while hCurrentWindow <> 0 do
    begin
    if Getwindowtext(hcurrnetwindow,@sztext,255)>0 then listbox1.items.add(strpas(@sztext));
    hCurrentWindow:=Getwindow(hCurrentwindow,GW_HWndNext);
    end;
    end;列举当前系统运行进程
    uses TLHelp32;
    procedure TForm1.Button1Click(Sender: TObject);
    var lppe: TProcessEntry32;
    found : boolean;
    Hand : THandle;
    begin
    Hand := CreateToolhelp32Snapshot(TH32CS_SNAPALL,0);
    found := Process32First(Hand,lppe);
    while found do
    begin
    ListBox1.Items.Add(StrPas(lppe.szExeFile));
    found := Process32Next(Hand,lppe);
    end;
    end;