locked
Is there an interface to send suspend or resume or close events to metro apps

    Question

  • Is there an interface that allows one application to suspend an active metro app, or to resume one that is inactive or to close one?

    With desktop apps this is handled through either the PostMessage interface or the SetActiveWindow, ShowWindow or SetWindowPos interfaces.

    Thanks

    Wednesday, July 25, 2012 1:30 AM

All replies

  • Hello,

    Generally speaking, we should left the system to control application lifecycle.
    We should not provide customer a way to close the metro application.
    http://msdn.microsoft.com/en-us/library/windows/apps/hh465088.aspx

    But if we want to test the suspend or resume function, we can use Visual Studio to do this.
    Please check To simulate suspending, terminating, and restoring an app in Visual Studio section
    http://msdn.microsoft.com/en-us/library/windows/apps/hh986968.aspx

    Best regards,
    Jesse


    Jesse Jiang [MSFT]
    MSDN Community Support | Feedback to us

    Thursday, July 26, 2012 9:06 AM
  • The only scenario we would support this type of interaction is when debugging a Metro style app. Outside of Visual Studio you can use the IPackageDebugSettings  API for that purpose. There is an older sample posted by the community which uses that API: WinRT Package Debug Tool


    David Lamb

    Thursday, July 26, 2012 8:12 PM
    Moderator
  • I tried the IPackageDebugSettings interface -- using the suspend() method seems to end up killing a metro app.

    Look, all I really want is to be able to do what the "Switch to" option does on the windows 8 task manager for a suspended task.  So some interface must exist?  This functionality also exists in the W8 alt/tab display -- the ability to control which of the "active" (running or suspended) immersive apps displays.


    MC Soft

    Friday, July 27, 2012 2:40 PM