问题
I am looking for a way to launch/run windows store apps on windows 10/8.1 from C#.
Examples of the apps I am trying to run are
- Calculator
- Photos
- Settings
Note: in Windows 10 these are no longer standard .exe files that can be executed by double clicking or calling Process.Start() as they are now windows store apps.
I have tried to use IApplicationActivationManager but I cannot find decent documentation with examples of how to use it.
回答1:
There are several ways to do it. The easiest way is to use Process.Start
and the URL or file handlers.
For example this will open the Video app:
Process.Start("microsoftvideo://");
Or the Store on the updates page:
Process.Start("ms-windows-store:updates");
Or the Photos app:
Process.Start("ms-photos://");
There are several more handles, some of them can you find here. You can find the names when you open the registry key HKEY_CLASSES_ROOT\Extensions\ContractId\Windows.Protocol\PackageId
. Look for the CustomProperties
key. It has an attribute Name
. That is the one to use.
Some other useful pointer can be found on SU: How do I run a Metro-Application from the command-line in Windows 8?.
来源:https://stackoverflow.com/questions/32074404/launching-windows-10-store-apps