I want to get the process id of a running Metro app programatically via C++ code, from another process. I have the static information of that app like name, full name etc. What is the API to do that? I can't use EnumProcess since the running Metro App is being run inside app container WWAHost.exe, so I can't know which of the running WWAHost.exe processes is actually running my Metro App.
In process explorer, I noticed that the Current directory of the WWAHost.exe process which is executing my Metro App is same as metro app install location. Could this be the differentiating factor between all the running app containers? If yes, what is the way to get current directory of another process?
To update, I have got some a solution regarding this on msdn forums. Here's the link:
http://social.msdn.microsoft.com/Forums/en-US/windowsgeneraldevelopmentissues/thread/c9665bf4-00e4-476c-badb-37126efd3f4b/
But, the solution uses an undocumented mechanism on Windows to get current directory of another process. I would like to use that solution only if there's no other way.