Find all threads by process

I am trying to find if there is a better way to find all thread tags that are relevant to the current process. It seems like using CreateToolhelp32Snapshot with TH32CS_SNAPTHREAD and iterating over threads to check if the thread process ID is equal to the current process ID is the solution, but I want to avoid iterating all the running threads. I just want to iterate over threads related to this process. Please let me know if there is an API that is fast and simple. I need to do this in C ++.

Thank you, Abhinay.

+5
source share
2 answers

" " - , , , DllMain , DLL_THREAD_ATTACH DLL_THREAD_DETACH. , .

+1

CreateToolhelp32Snapshot TH32CS_SNAPPROCESS (0x00000002) , Thread32First function.

.

0

All Articles