How to know calling process name?

D

David Hoffer

I have a C# NET dll in which I need to know the name of the application
(process) that loaded (is executing) my dll.

In one case, the dll gets loaded in a rather complicated manor. I.e. a MFC
application loads an IE browser and then script calls NET components exposed
as COM dlls. These dlls in turn load mine. How can I know the name of that
MFC exe that started this?

-dh
 
R

Robert Jordan

David said:
I have a C# NET dll in which I need to know the name of the application
(process) that loaded (is executing) my dll.

In one case, the dll gets loaded in a rather complicated manor. I.e. a MFC
application loads an IE browser and then script calls NET components exposed
as COM dlls. These dlls in turn load mine. How can I know the name of that
MFC exe that started this?


System.Diagnostics.Process.GetCurrentProcess().ProcessName

bye
Rob
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top