0

My question is - is there a quick way of viewing all threads a current process has opened , given the PID ?

I know of toolhelp snapshots , but enumerating through all of the threads in the system sounds a bit ... uncomfortable .

I'm looking for a quicker solution , I'd be glad to hear your suggestions .

Thanks !

Seth Carnegie
  • 73,875
  • 22
  • 181
  • 249
Danny Shemesh
  • 67
  • 1
  • 9
  • 2
    `CreateToolhelp32Snapshot` can take a process ID so you don't have to iterate all the threads in the entire system. – Seth Carnegie May 26 '12 at 23:23
  • Hey , thanks a lot ! It's just msdn says the snapshot will ignore the pid in case of not using the flags of snapmodules , snapheaplist or snapall (which includes each and every running thread , and the heap and modules for the given pid) . – Danny Shemesh May 27 '12 at 06:54
  • possible duplicate of [Enumerating threads in Windows](http://stackoverflow.com/questions/1206878/enumerating-threads-in-windows). .Net has an API to do this, but internally it just filters a global list of threads (from performance data, IIRC) which suggests there isn't any way of directly getting just the threads for a single process. – arx May 27 '12 at 09:51

0 Answers0