简体   繁体   中英

Invoking desktop app from Windows Store app

I have a Windows form desktop application developed using c#. I want to make use of the live tile feature available in WinRT apps (especially for Windows 10). The data in the live tile is to be fetched using WMI queries (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. Is it possible to fetch WMI data and invoke exe from Windows Store apps? 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 . But could not get it to work as I get a 'TypeLoadException'.

Thanks in advance.

Metro app can't run a desktop app. However, they can commumicate using wcf . So, you can create tiny windows service that will open wcf host. Then you create windows store app with your live tile(s). When windows service recieves a wcf call, it starts the desktop application.

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/

WinRT blocks network loopback so wcf won't work. 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).

https://msdn.microsoft.com/en-us/library/windows/apps/Hh780593.aspx

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM