Windows 8 start “metro” app from desktop app?

心不动则不痛 提交于 2019-12-21 21:13:48

问题


Is there any way to start a "Metro" app from a desktop app in .net?


回答1:


All Modern UI apps have a URL protocol associated with them which can be used to launch the app.
You can find find the protocol for a specific app like this:

  1. Press Windows+R
  2. Type regedit
  3. Navigate to HKEY_CLASSES_ROOT\Extensions\ContractId\Windows.Protocol\PackageId
  4. Find the subkey for your app (eg, AMZNMobileLLC.KindleforWindows8_1.1.0.0_neutral__stfe6vwa9jnbp)
  5. Within that subkey, go to ActivatableClassId_some long name_\CustomProperties
  6. The Name value will tell you the protocol name.

You can then pass name:// to Process.Start().

(I answered this on SuperUser)




回答2:


I found another way, to start win8 app from a win32 app.

  1. In your WinRt project go to Package.appxmanifest -> declarations
  2. Add File Type Associations and in Name field enter: myAppLaunch, in File Type enter .myAppLaunch (with dot)
  3. Create a file (on the Descktop for e.g) and set .myAppLaunch as extension.
  4. Now, in you Win32 app, execute that file.


来源:https://stackoverflow.com/questions/14143341/windows-8-start-metro-app-from-desktop-app

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