Today I want to share with you a small tool with C/C++ code to get process threads, this tool will get all the threads in the system and show you some information about the thread and the process that run this thread.
In this guide we will focus on the following:
- Global threads count in task manager.
- Thread count per process using task manager.
- A small command-line tool name ThreadsInfo with C/C++ source code.
If you are asking yourself how to check number of threads in windows you can do the following, in Windows 10:
- Open task manager.
- Go to the Performance tab.
- Make sure CPU is selected
You can see the number of threads currently running on your system.
Here is a screen for that:
But what if you want more, you want to know threads count for each running process.
No Problem, you can also do that from Task Manager. Here is how:
- Open task manager.
- Go to the Details tab.
If you do not see the threads count. please refer to the next paragraph.
Adding the threads count per process in task manager:
If you do not see the threads count, you can add the threads column to the items you see.
- Right click on one of the items in the title – number 1 in the image.
- Press on the select column option.
- In the list that opens, scroll down to threads – number 2 in the image.
- Mark threads and press OK.
- Now you can see the number of threads per process.
But what if you want more information about the threads.
The get process threads tool:
The code is base on Microsoft traversing the thread list code.
The ThreadsInfo command-line tool:
Using code, and API function, we can “travel” the list of threads that running on the system. But not only that we can query the thread and get information from it. In this version, we are only the thread ID, Priority and the parent name of the thread process. The exe file.
You can download the tool source code (C/C+) from:
ThreadsInfo source code (5306 downloads )The code was build in Visual Studio 2015 but can be used in any other version. Please create a C/C++command line project to run this tool.
Hope this article – How to get process threads in Windows 10 was helpful if you have question, comments or you want us to upload a compile (exe) version of the tool. Please contact us using the contact page or comment on this article.