[英]Invoking desktop app from Windows Store app
I have a Windows form desktop application developed using c#. 我有一个使用c#开发的Windows窗体桌面应用程序。 I want to make use of the live tile feature available in WinRT apps (especially for Windows 10).
我想利用WinRT应用程序中可用的实时平铺功能(尤其是Windows 10)。 The data in the live tile is to be fetched using WMI queries (Win32_LogicalDisk).
实时磁贴中的数据将使用WMI查询(Win32_LogicalDisk)来获取。 How do I accomplish this?
我该如何完成? I don't want to rewrite the entire app.
我不想重写整个应用程序。 Live tiles should update on the background and on clicking the tile, my desktop app exe needs to be invoked.
实时磁贴应在背景上更新,并且单击磁贴时,需要调用我的桌面应用exe。 Is it possible to fetch WMI data and invoke exe from Windows Store apps?
是否可以从Windows Store应用程序中获取WMI数据并调用exe? I tried using Brokered Windows Runtime components as given in http://blogs.msdn.com/b/dmx/archive/2014/04/30/how-to-trigger-a-desktop-process-from-windows-store-apps-the-easy-way-using-the-brand-new-visual-studio-templates.aspx .
我尝试使用http://blogs.msdn.com/b/dmx/archive/2014/04/30/how-to-trigger-a-desktop-process-from-windows-store-中给出的Brokered Windows Runtime组件应用程序使用品牌新的Visual Studio Studio.aspx的简便方法 。 But could not get it to work as I get a 'TypeLoadException'.
但是由于我收到“ TypeLoadException”,无法使其正常工作。
Thanks in advance. 提前致谢。
Metro app can't run a desktop app. Metro应用无法运行桌面应用。 However, they can commumicate using wcf .
但是,它们可以使用wcf进行通信 。 So, you can create tiny windows service that will open wcf host.
因此,您可以创建可打开wcf主机的微型Windows服务。 Then you create windows store app with your live tile(s).
然后,使用活动磁贴创建Windows应用商店应用。 When windows service recieves a wcf call, it starts the desktop application.
当Windows服务收到wcf调用时,它将启动桌面应用程序。
There is also devexpress' solution that is capable of adding live tiles for desktop apps, however it is not free: https://www.devexpress.com/Products/NET/Controls/WinForms/Live-Tile-Manager/ 还有devexpress的解决方案,可以为桌面应用程序添加实时磁贴,但是它不是免费的: https ://www.devexpress.com/Products/NET/Controls/WinForms/Live-Tile-Manager/
WinRT blocks network loopback so wcf won't work. WinRT会阻止网络环回,因此wcf将无法工作。 You can disable this for testing but I suspect that won't satisfy you.
您可以禁用此功能进行测试,但我怀疑这不会满足您的要求。 Read more here (and search for WinRT network loopback to find articles on this topic).
在此处阅读更多信息(并搜索WinRT网络环回以找到有关此主题的文章)。
https://msdn.microsoft.com/en-us/library/windows/apps/Hh780593.aspx https://msdn.microsoft.com/zh-CN/library/windows/apps/Hh780593.aspx
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.