Start metro app (camera) from WPF application

二次信任 提交于 2019-12-12 09:56:02

问题


I have a ordinary .net 4 WPF application which is supposed to be run on a Windows 8.1 tablet. From this application I would like to start the native Metro camera app, if it is available.

I´ve tried looking for answers, but it seems to require a Windows app to start metro apps.

So is it even possible?

Thank you :)


回答1:


Have a look at this article: http://winaero.com/blog/exclusive-how-to-start-a-modern-app-from-desktop-without-going-to-the-metro-start-screen/

Basically, you need to run:

explorer shell:AppsFolder\Microsoft.MoCamera_cw5n1h2txyewy!Microsoft.Camera

e.g. Use:

Process.Start("explorer", @"shell:AppsFolder\Microsoft.MoCamera_cw5n1h2txyewy!Microsoft.Camera");

I'm not sure that this will be super reliable or future-proof, but it works on all of the Windows 8.1 machines that I have tried it on!




回答2:


There's a way to open metro apps (Windows Store apps) from desktop, but the app is required to have a protocol associated with it. Goto Control Panel > Default Programs > Associate protocol... (something like that) and check for protocols associated with each app..

Unfortunately, the default camera app doesn't seem to have any protocol.

The .exe file for camera app lies in C:\Windows\Camera folder for Windows 8.1 (I am not sure if it was there in Windows 8) but double-clicking that doesn't do anything. I guess only Windows knows how to start it.

Here's how you can test starting apps by protocol: Open IE or any other browser and type: ms-windows-store:/ in the address bar.



来源:https://stackoverflow.com/questions/22475520/start-metro-app-camera-from-wpf-application

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