Launching windows 10 store apps

此生再无相见时 提交于 2019-12-04 12:07:32

问题


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

  1. Calculator
  2. Photos
  3. 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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!