O'Reilly logo

Mastering Windows 8 C++ App Development by Pavel Yosifovich

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Background tasks

Windows Store applications may be suspended when the user switches to another app. The app may still want some work to happen even while the app is suspended and even terminated. This is the job of background tasks.

What is a task?

A task is just a class that implements the Windows::ApplicationModel::Background::IBackgroundTask interface, having just one method, Run. This class must be placed in a separate project from the main application, in a Windows Runtime Component type project. This is essential, as tasks run in a separate process, and thus cannot be bound with the main app (so they are not suspended if the main app is suspended).

The main application needs to reference the project where the task(s) are located, and indicate ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required