My winform application is launched by another application (the parent), I need determine the pid of the application which launch my application using C#.
My winform application is launched by another application (the parent), I need determine the
Share
WMI is the easier way to do this in C#. The Win32_Process class has the ParentProcessId property. Here’s an example:
Output when run from Visual Studio: