Hi all!

How to get the name of the related DLL for a thread in a process like Process Explorer in C#?

1. I use Process[] _processlist = Process.GetProcesses(); to get all the processes running.

2. I use ProcessThreadCollection _processthreadcollection = _processlist[0].Threads ( in a foreach loop in my code ) to get the threads each process uses.

Now, I can get the process id and thread id but I don't know how to get the DLL/EXE/FUNCTION name of the threads?

In "Process Explorer" if you double click on a process and go to "Threads" tab, you get a list of all thread and in "Start Address" you can see which DLL is each thread related to.

But in C# code the start address of each thread is just a pointer not a string. I wonder how "Process Explorer" does it? Any chance someone here could write a small C# sample code for me?

I would GREATLY appreciate it.

Process Explorer