Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Windows API's which will show the running processes

I want to create a tool like mini task manager. I want to show all the running processes, cpu and memory usage. Can anybody tell me related api's which I can use for this. Any link to related web page will be appreciated. (I want dump of all the statistics of running processes, cpu and memory.) Thanks in advance.

like image 679
user562495 Avatar asked Jan 04 '11 12:01

user562495


People also ask

How do I see running processes in Windows?

Hold Ctrl+Shift+Esc or right-click on the Windows bar, and choose Start Task Manager. In Windows Task Manager, click on More details. The Processes tab displays all running processes and their current resources usage.

Which API used in Windows?

The Windows UI API creates and uses windows to display output, prompt for user input, and carry out the other tasks that support interaction with the user. Most applications create at least one window.

How do you check if a process is running in Windows C++?

You can check whether the exit code is STILL_ACTIVE and if so, you can call WaitForSingleObject(processHandle, 0) and check whether the return value is WAIT_TIMEOUT . If so, the process is still active, otherwise the process has returned 259 as exit code.

How can I see what process is using a program?

In Windows, this utility is the Task Manager. To get it, right-click on the Taskbar and select Task Manager from the pop-up menu that appears. This utility list all processes in categories. The first category is Apps, which are the processes that the user sees on the screen.


2 Answers

To do that, you will need to use the tool help functions to get snapshots of the system.

Here is a code example.

like image 159
Jon Avatar answered Oct 04 '22 22:10

Jon


You can use EnumProcess and openProcess to do this. Here is a complete sample code for this: http://msdn.microsoft.com/en-us/library/ms682623%28v=vs.85%29.aspx

like image 40
Vikram.exe Avatar answered Oct 05 '22 00:10

Vikram.exe