I’m stuck with the process model of IE8, where a GetWindowThreadProcessId() for my MFC embedded window will give me a child IE PID, as the GetWindowThreadProcessId() for my container page will give me the root IE PID.
Which is bad, as I want to filter my container out, while enumerating windows.
So I’m looking for a way to get the PID of the parent of a given process, so as to get, from my MFC app, the root IE PID.
Sysinternals’ ProcessExplorer knows how to do that, displaying processes in treeview, so I’m sure there’s a way to achieve that.
Have you seen this codeproject article or this codeguru article?
I think the better method is in the codeguru article.
Basically you want the ‘ULONG InheritedFromUniqueProcessId’ member of PROCESS_BASIC_INFORMATION. See NtQueryInformationProcess and this page.