var hModule:Thandle; lpme: TModuleEntry32; bFind:Bool; begin memo1.Clear; lpme.dwSize:=sizeof(TModuleEntry32); hModule:=CreateToolhelp32Snapshot(TH32CS_SNAPMODULE,GetCurrentProcessID); bFind:=Module32First(hModule,lpme); while bFind do begin memo1.Lines.Add(lpme.szModule+' Path: '+lpme.szExePath); bFind:=Module32Next(hModule,lpme); end; CloseHandle(hModule);记得对TLHelp32单元的引用。
hModule:Thandle;
lpme: TModuleEntry32;
bFind:Bool;
begin
memo1.Clear;
lpme.dwSize:=sizeof(TModuleEntry32);
hModule:=CreateToolhelp32Snapshot(TH32CS_SNAPMODULE,GetCurrentProcessID);
bFind:=Module32First(hModule,lpme);
while bFind do
begin
memo1.Lines.Add(lpme.szModule+' Path: '+lpme.szExePath);
bFind:=Module32Next(hModule,lpme);
end;
CloseHandle(hModule);记得对TLHelp32单元的引用。