简体   繁体   English

从Windows应用商店应用调用桌面应用

[英]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.

相关问题 如何从桌面应用解密Windows Store DPAPI保护的数据 - How to decrypt Windows Store DPAPI protected data from desktop app 如何从C#桌面应用程序中检索Windows应用商店应用程序的图标? - How do I retrieve a Windows Store app's icon from a C# desktop app? 从Windows应用商店打印 - printing from windows store app 是否可以在同一解决方案中开发Windows 8.1桌面和商店应用程序? - Is it possible to develop for Windows 8.1 Desktop and Store App in the same solution? Windows桌面应用程序的本地化 - Localization of Windows Desktop app Windows 8商店 - 调试应用程序从商店下载 - Windows 8 Store - Debug App Downloaded from store 是否可以使用带有Metro界面的Windows桌面应用程序(或不打算去Windows商店的Metro应用程序)? - Is it possible to have a windows desktop app with metro interface (or a metro app with no intention of going to the windows store)? 我可以将Windows存储应用程序C#代码(命名空间)用于桌面应用程序吗? - Can i use windows store app C# code (namespace) for desktop app? 如何将现有的Windows Store App(Metro风格)移植或转换为Desktop App? - How to Port or Convert existing Windows Store App(Metro Style) to Desktop App? 我可以轻松地将Windows Store桌面应用程序转换为通用或电话应用程序吗? - Can I easily convert windows store desktop app to universal or phone app?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM