How to know calling process name?

  • Thread starter Thread starter David Hoffer
  • Start date Start date
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
 
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
 
Back
Top