locked
Invoking desktop app from Windows store App

    Question

  • Hi,

    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.

    Friday, April 03, 2015 9:01 AM

Answers

  • First, we'll assume that you're writing an LOB app, not an app intended for Store distribution, as you are trying to use a brokered component.

    The use of a brokered component is the correct thing for you to do in this case, as neither WMI nor Process.Start are available to regular Windows Store apps.  It's just a matter of proper creation of the brokered windows component for you to get going.

    My buddy Prashant wrote a cheatsheet for Brokered Components. I know it works as I've followed it myself:
    http://blogs.msdn.com/b/wsdevsol/archive/2014/04/14/cheat-sheet-for-using-brokered-windows-runtime-components-for-side-loaded-windows-store-apps.aspx


    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    Friday, April 03, 2015 12:35 PM
    Moderator