Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2010-08

Library for checking running processes and their command lines in Windows

2 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Frank Church

Does Lazarus have a library or component for listing running processes on Windows, with the ability to terminate them?

I am looking for a library which can return the same info as tasklist.exe or Sysinternals pslist in text mode format?

The important thing is know the full command line options it was invoked with. WMIC.exe doES the trick but it can only be run wih administrator rights.

I will settle for an API which will return the command line options given the PID.

Frank Church ======================= http://devblog.brahmancreations.com -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20100816/593158de/attachment.html>

Reply by email

Sven Barth
to Frank Church
Frank Church wrote 13 lines
Does Lazarus have a library or component for listing running processes on Windows, with the ability to terminate them? I am looking for a library which can return the same info as tasklist.exe or Sysinternals pslist in text mode format? The important thing is know the full command line options it was invoked with. WMIC.exe doES the trick but it can only be run wih administrator rights. I will settle for an API which will return the command line options given the PID.

I don't know of a specific API for this, but you could try the Delphi code mentioned here:

http://www.delphipraxis.net/764306-post.html#873389

It should work with FPC as the jwa*-units are included with FPC. The text above - if you can't read German - says that the code doesn't work for 64-bit processes (when using a 32-bit process, as Delphi is - currently - 32-bit only) and he wants to check whether there is a 64-bit equivalent of the PEB. I didn't yet check whether he found a solution.

Regards,
Sven

Reply by email