O'Reilly logo

Professional Windows 7 Development Guide by John Paul Mueller

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

Chapter 14. Working in the Background

WHAT'S IN THIS CHAPTER?

  • Considering why your application should work in the background

  • Creating a trigger-start service

  • Providing power management

  • Adding restart and recovery to your application

  • Accessing the network list manager

Applications can run either in the foreground, where the user interacts with them, or in the background, where they perform tasks independently. A word processor is an example of a foreground task. The user starts a new document, types some text into it, formats it, and performs other tasks with it. A service, such as Windows Time, is an example of a background application. Windows Time can maintain time synchronization just fine without any user interaction.

However, the lines between foreground and background tasks aren't absolute. A word processor can employ a background task to print a document upon user request. The user can continue working in the foreground with the document while the word processor prints it in the background. Likewise, the W32Tm utility lets you interact with the Windows Time service. You might choose to resynchronize the local machine with an Internet time source, which means requesting the action from the Windows Time service, using the W32Tm utility.

Many of the examples in the book are necessarily foreground tasks because you want to see how a particular Windows 7 feature works. This chapter takes another approach to working with Windows 7. The sections that follow discuss background tasks and ...

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