请帮忙看一段代码?
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中什么也没有(list1是一个listbox)