2

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

3 Answers 3

8

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

Sign up to request clarification or add additional context in comments.

Comments

2

You might find the EnumProcesses function useful.

Comments

1

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...

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.