Windows Dev Center

How do I determine when the app has been moved off screen?


  • I have several scenarios where I want to know when the application has been replaced on the screen, or has come back onto the screen. For example,

    1. Games will want to pause and stop timers when the application goes off screen and restart when they come back on screen.
    2. Applications playing media (sound or video) may want to stop/start playing when they go off screen.


    The only events that I can find are the LayoutChanged, OrientationChanged and Suspending/Resuming, but none of these are correct or happen at the right time. The closest is the Suspending/Resuming, but these happen at least 5 seconds after the app has been replaced.

    I have noticed that the demo apps on the tablet we received at build don't seem to handle this either. For example, timed games continue timing until they are suspended and several programs continue playing sound for several seconds when they go off screen. This is fairly annoying...

    So, how should I handle this in my apps? Are there focus events I can subscribe to or an event I haven't found yet?


    • Edited by Rob Prouse Monday, September 19, 2011 5:38 PM
    Monday, September 19, 2011 3:27 PM


  • Hi Rob - Right now there aren't any events which handle this scenario, but we are looking at solutions surrounding this for Beta.



    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    Monday, September 19, 2011 5:12 PM

All replies