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.

相关阅读 >>

firemonkey listbox 的几个事件:拖动,点击,长按

Delphi nativexml的中文支持

Delphi 系统服务状态获取管理员用户名

Delphi pagecontrol当前页可视

Delphi 程序嵌入桌面效果的实现

Delphi txt编码互转 ansi utf-8

Delphi xe8 用httpclient下载文件

Delphi中使用 twebbrowser 编辑网页

Delphi 判断网络是否连通

Delphi firemonkey处理图形的方式与vcl处理图形的方式大不相同

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



打赏

取消

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

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

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

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

评论

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