Is there any way to determine the PID of a process that was started by instantiating a COM coclass?
For example:
MyApp.ApplicationClass anApp = new MyApp.ApplicationClass();
would start the process myapp. Potentially there are already a lot of myapp processes running when this code is executed.
My current solution to acquire the latest PID feels a bit awkward: I memorize the list of running processes before creating the new instance and take the delta of running myapp PIDs when the new instance was created.
Is there an standard/better way to accomplish this?
Edit: The PID is later used to identify/monitor the created process.