Is it possible to open or to manage at all Windows 8 apps (e.g. the built-in Mail or News app) via WinAPI functions from a desktop program?
With ‘manage‘, I mean to open, close, snap (to left and right) or to enumerate Windows 8 apps.
I know that apps can register for special URI schemes so they can be opened by a link (and probably via ShellExecute() and related functions), but what if they don’t?
I’ve just found a blog post of Ashwin Needamangala in a Win8 App Dev blog which covers app activation and automating lifecycle states with C++, WinAPI and COM: http://blogs.msdn.com/b/windowsappdev/archive/2012/09/04/automating-the-testing-of-windows-8-apps.aspx
Enumeration works via the PackageManager class.
Opening an app is possible using the IApplicationActivationManager interface.
And if you’re the one who opened it and you have a handle, you can probably call TerminateProcess on it, too, but I haven’t tried that one.
Edit: we open-sourced our apprunner utility, it can install, run and uninstall packages and shows the use of PackageManager and IApplicationActivationManager.
Apart from that, other interaction (i.e. snapping/unsnapping) doesn’t seem to be possible from the outside.