procedure RefreshList; //刷新进程列表
var
h:THandle;
procEntry32:TProcessEntry32;
isEnd:Bool;
s:ShortString;
begin
list1.clear;
h:=createToolhelp32snapshot(TH32CS_SNAPPROCESS,0);
procEntry32.dwSize:=sizeof(TProcessEntry32);
isEnd:=Process32First(h,procEntry32);
while isEnd do
begin
GetModuleFileName(openProcess(Process_All_Access, true,procEntry32.th32ProcessID),@s,255);
list1.Items.Add(s);
isEnd:=Process32Next(h,procEntry32);
end;
CloseHandle(h);
end;但不知为什么list1中总是空值?
不要说用procEntry32.szexefile来得到进程,这种方法在2000下只能得到文件名。
var
h:THandle;
procEntry32:TProcessEntry32;
isEnd:Bool;
s:ShortString;
begin
list1.clear;
h:=createToolhelp32snapshot(TH32CS_SNAPPROCESS,0);
procEntry32.dwSize:=sizeof(TProcessEntry32);
isEnd:=Process32First(h,procEntry32);
while isEnd do
begin
GetModuleFileName(openProcess(Process_All_Access, true,procEntry32.th32ProcessID),@s,255);
list1.Items.Add(s);
isEnd:=Process32Next(h,procEntry32);
end;
CloseHandle(h);
end;但不知为什么list1中总是空值?
不要说用procEntry32.szexefile来得到进程,这种方法在2000下只能得到文件名。
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货