Beginner questions

delphi package - easy access to kernel objects etc.
Post Reply
stOrM!
Posts: 51
Joined: Thu Jul 15, 2004 7:38 pm

Beginner questions

Post by stOrM! »

Maybe I misunderstood, but can someone show me please how do I get the Imported and Exported Module Filenames?

I did something like:

Code: Select all

For I := 0 To Processes.ItemCount -1 Do
   with Processes do
   begin
     GridView2.AddRow();
     GridView2.Cell[0, I].AsString := Process(ProcName).Modules[I].FileName;
For the Exportlist but how to get the importlist?
Also if possible I'm not sure how to get for every Modul the
Versionsnumber and the OS + Filetype like:
Version 1.0, Windows XP, Win32...

From the Help:
property IProcess.OsVersion : TOsVersion;
property IProcess.ExeType : TExeType;

But how to read them and put the result into a string?
Same for the Thread priority...
madshi
Site Admin
Posts: 10754
Joined: Sun Mar 21, 2004 5:25 pm

Re: Beginner questions

Post by madshi »

stOrM! wrote:

Code: Select all

For I := 0 To Processes.ItemCount -1 Do
   with Processes do
   begin
     GridView2.AddRow();
     GridView2.Cell[0, I].AsString := Process(ProcName).Modules[I].FileName;
Please always use "with" as often as you can, when using madKernel interfaces. Or else madKernel has to redo enumeration again and again. Everytime you call "Processes" madKernel has to enumerate all running processes again. So use "with Processes do". You're calling it twice in your code, which results in double work for madKernel.

Your code doesn't make any sense to me. Where does "ProcName" come from? The index "I" is iterating through all running processes. But you're using it to reference modules of a specific process? That just doesn't make any sense!
stOrM! wrote: property IProcess.OsVersion : TOsVersion;
property IProcess.ExeType : TExeType;

But how to read them and put the result into a string?
Same for the Thread priority...
You can use a "case" instruction to put out a string for each element of the enumeration values. Or you can setup an array like "var OsVersionNames : array [TOsVersion] of string = ['bla', 'bla', 'bla']", then you can use "OsVersionNames[SomeProcess.OsVersion]".
stOrM!
Posts: 51
Joined: Thu Jul 15, 2004 7:38 pm

re

Post by stOrM! »

Ok I understand calling it twice always wouldn't be that good for speeding up things :D

ProcName : String;

Procname holds the Name of the Process which comes from another GridView the Screenshot already posted here...
So its like when an Item is selected (Process) from another Grid, Procname is filled with the Processname...

Hmm I was assuming by the code when you select a process frmo the processlist, then display all used dll's for that process :o

Ok I see how to I get the TOSVersion now, (I have to learn a lot guess) :confused:

thank you
s!
Post Reply