List running processes/applications

Started by Sammo, November 13, 2005, 03:14:56 PM

Previous topic - Next topic

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

#1
Hmmm... Is there a function that can push control-alt-delete? :-)
\"Give me a Kaypro 64 and a dial tone, and I can do anything!\"

HPW

#2
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

#3
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

#4
I've used autoit http://www.autoitscript.com/autoit3/downloads.php">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

#5
>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