locked
CoreWindow.Closed

    Question

  • Doc said "Is fired when a window is closed (or if the app terminates)."

    It is not fired when I press ALT+F4.

    How to "close" the app's main window then this event will fire?


    C++ DX11



    • Edited by Raptor K Thursday, April 26, 2012 1:37 PM
    Thursday, April 26, 2012 1:31 PM

Answers

  • Hello,

    You should handle it in the Suspending | suspending event.

    won't pass the Store certification process.
    There's no special event to indicate that the user has closed an app. After an app has been closed by the user, it's suspended and terminated, entering the NotRunning state within about 10 seconds. If an app has registered an event handler for the Suspending | suspending event, it is called when the app is suspended. You can use this event handler to save relevant application and user data to persistent storage.

    Please check the App close section in this document
    http://msdn.microsoft.com/en-us/library/windows/apps/hh464925.aspx

    Best regards,
    Jesse


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

    • Marked as answer by Raptor K Friday, April 27, 2012 1:20 PM
    Friday, April 27, 2012 9:30 AM