tags:

views:

102

answers:

3

In Windows I would like the C++ command or reference that would get the "tasklist" in C++ and output it to a buffer?

+2  A: 

You might find the EnumProcesses function useful.

Logan Capaldo
+8  A: 

Use EnumProcesses() to get the process identifiers, use OpenProcess() to get their handles and get the information you need via the usual process functions.

Georg Fritzsche
+1  A: 

There are two basic routes: PSAPI, and ToolHelp32. If you want to badly enough, you can also use the Native API. The Sysinernals Web site used to provide full source code to a process explorer utility that used the Native API to do its tricks. Then Microsoft bought out SysInternals, and shortly after that, the source code disappeared and is no longer available.

If you look hard, you might be able to find some old articles and such telling how to use it, but it's probably not going to be as easy as it should be...

Jerry Coffin