Click to See Complete Forum and Search --> : getting thread associated with a process
veerpiv
February 13th, 2006, 05:06 AM
hi,
How do i get the id(dword) of the thread associated with a given process say if i have the exe name as test.exe..
rgds,
veerpiv
Marc G
February 13th, 2006, 07:12 AM
[ moved thread ]
kirants
February 13th, 2006, 12:05 PM
How do i get the id(dword) of the thread associated with a given process say if i have the exe name as test.exe..
A given process ( identified by it's process ID ) can have multiple threads of execution within it ( identified by thread IDs ).
So, if test.exe is running , what is it that you want ? The thread IDs of all threads spawned by the process ?
Siddhartha
February 13th, 2006, 02:59 PM
How do i get the id(dword) of the thread associated with a given process say if i have the exe name as test.exe..You can use the Tool Help Library to detect threads in a process.
The samples and links here should help -
Taking a snapshot and viewing processes (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/perfmon/base/traversing_the_module_list.asp)
Traversing the Thread List (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/perfmon/base/traversing_the_module_list.asp)
Use the former to detect your process and get it's ID.
Use the latter to enumerate the threads running given that Process ID.
Is this what you are looking for?
Andreas Masur
February 13th, 2006, 03:04 PM
Take a look at this article (http://www.codeproject.com/system/ntenumthreads.asp)...
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.