List running processes/applications

Machine-specific discussion
Unix, Linux, OS X, OS/2, Windows, ..?
Locked
Sammo
Posts: 180
Joined: Sat Dec 06, 2003 6:11 pm
Location: Loveland, Colorado USA

List running processes/applications

Post by Sammo »

Does anyone know of a windows function and associated DLL that will return a list of all running processs and/or applications — lists similar to those provided by Task Manager?

Thanks,
-- Sam

Ryon
Posts: 248
Joined: Thu Sep 26, 2002 12:57 am

Post by Ryon »

Hmmm... Is there a function that can push control-alt-delete? :-)

HPW
Posts: 1390
Joined: Thu Sep 26, 2002 9:15 am
Location: Germany
Contact:

Post by HPW »

Sam,

For which platform?

There is a 'NtQuerySystemInformation' in 'ntdll.dll' which seems to do this on NT/WIN2K/XP. Quite complicated. I have found a delphi-snippet.

Do you need it in neobook?
Hans-Peter

Sammo
Posts: 180
Joined: Sat Dec 06, 2003 6:11 pm
Location: Loveland, Colorado USA

Post by Sammo »

Hello Hans-Peter,

Yes, I need it in Neobook. The best solution would support Win98 as well as WinNT, Win2K and WinXP.

Thanks,
-- Sam

nigelbrown
Posts: 429
Joined: Tue Nov 11, 2003 2:11 am
Location: Brisbane, Australia

Post by nigelbrown »

I've used autoit http://www.autoitscript.com/autoit3/downloads.php to access systems type functions (from a Basic program) to manipulate clipboard and control a browser and autoit always worked well.
I see they have a function:

ProcessList
--------------------------------------------------------------------------------

Returns an array listing the currently running processes (names and PIDs).
their example is:
; List all processes
$list = ProcessList()
for $i = 1 to $list[0][0]
msgbox(0, $list[$i][0], $list[$i][1])
next

to use the autoit dll in basic was easy.

May be worth a look.

Nigel
PS update - looking further at the dll functions the process listing is not callable - only checking if a specified process is running (see:
ProcessExists
--------------------------------------------------------------------------------

Checks to see if a specified process exists. )

Autoit scripts can be compiled so an external exe could be made that when run leaves a list of active processes as a file somewhere to be consulted.

Depends on why you want the process list?

HPW
Posts: 1390
Joined: Thu Sep 26, 2002 9:15 am
Location: Germany
Contact:

Post by HPW »

>The best solution would support Win98 as well as WinNT, Win2K and WinXP.

After some test with a standalone EXE, I found that only WinNT must use 'ntdll.dll' for this. WIN95 run with the other code. Win2K and WinXP run with both variants. Have to check how to link dynamicly against 'ntdll.dll' that it is not loaded on startup, so it gives no error on systems where not present.
Hans-Peter

Locked