问题
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:
- Press Windows+R
- Type
regedit - Navigate to
HKEY_CLASSES_ROOT\Extensions\ContractId\Windows.Protocol\PackageId - Find the subkey for your app (eg,
AMZNMobileLLC.KindleforWindows8_1.1.0.0_neutral__stfe6vwa9jnbp) - Within that subkey, go to
ActivatableClassId_some long name_\CustomProperties - The
Namevalue 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.
- In your WinRt project go to
Package.appxmanifest -> declarations - Add
File Type Associationsand inNamefield enter:myAppLaunch, inFile Typeenter.myAppLaunch(with dot) - Create a file (on the Descktop for e.g) and set
.myAppLaunchas extension. - Now, in you Win32 app, execute that file.
来源:https://stackoverflow.com/questions/14143341/windows-8-start-metro-app-from-desktop-app