I'm doing some automation via a combination of windows message sending directly to HWNDs and calls to a COM server exposed by the automated application.
If there is more than one instance running, I need to be able to determine the process ID of the COM server so I can hit the same instance with the COM call as the one I'm sending windows messages to.
I can enumerate all the running COM servers with the running object table and get back monikers for all of them, but the COM objects themselves expose no methods I can use to get a window handle, thread ID, process ID, or anything of that sort.
Is there any way to figure out, based on a moniker or the actual binding COM object of the moniker, what the process ID of the COM server is?
Thanks!