Modules

delphi package - easy access to kernel objects etc.
Post Reply
Direct3D
Posts: 2
Joined: Wed Jan 04, 2006 2:58 pm

Modules

Post by Direct3D »

Hi, I tried:

Code: Select all

  ShowMessage(Process('explorer.exe').Modules.FileName);
But it does not work. :sorry:
I got only a messagebox without any content, but I want list all modules (.dll) witch are loaded.

Can someone help me?
PInvoke
Posts: 25
Joined: Sun Jan 16, 2005 4:32 am

Post by PInvoke »

try this

Code: Select all

procedure TForm1.Button1Click(Sender: TObject);
var
  iProc: IProcess;
  x: integer;
begin
  iProc := Process('explorer.exe');
  for x := 0 to iProc.Modules.ItemCount - 1 do
    ShowMessage(iProc.Modules[x].FileName);
end;

P.
Direct3D
Posts: 2
Joined: Wed Jan 04, 2006 2:58 pm

Post by Direct3D »

Thanks, it works fine.
madshi
Site Admin
Posts: 10753
Joined: Sun Mar 21, 2004 5:25 pm

Post by madshi »

The reason why the code in the original question doesn't work is that IModules.FileName is only meant to work if all modules in the container share the same file name, which is obviously not the case here.
Post Reply