Delphi 一个不错的枚举进程例子


本文整理自网络,侵删。

 Delphi 一个不错的枚举进程例子

代码很少 感觉很不错 芊芊小魔女的博客看到的 ! 喜欢的顶下

unit Unit1;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, StdCtrls,TlHelp32 ;

type
TForm1 = class(TForm)
lst1: TListBox;
tmr1: TTimer;
procedure tmr1Timer(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.tmr1Timer(Sender: TObject);
var
prophoto:THandle ;
openpro:ProcessEntry32;
bfirst:Boolean;
begin
lst1.Clear;
prophoto := CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS,0);
openpro.dwSize := SizeOf(openpro);
bfirst:=Process32First(prophoto,openpro);
while bfirst <> False do
begin
lst1.Items.Add(openpro.szExeFile + ' PID : ' +inttostr(openpro.th32ProcessID));
bfirst:=Process32Next(prophoto,openpro);
end;
CloseHandle(prophoto);

end;

end.

相关阅读 >>

Delphi tlistbox添加横向滚动条

Delphi xe6 读取android设备联系人

Delphi使用迅雷的开放下载引擎下载

Delphi xp 之后, Delphi 动注册表不方便了...逼出来一个办法:

Delphi的format使用总结

Delphi firedac sqlite不能插入"&"符号

Delphi研究之驱动开发篇(四)--使用系统内存堆

Delphi日期和时间

tidtcpclient控件中文指南

Delphi下的纯pascal的十六进制转十进制

更多相关阅读请进入《Delphi》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...