O'Reilly logo

Windows Application Development Cookbook by Marcin Jamro

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

Disabling switching off the screen

When the screen is not touched by a user for a long period of time, it could be switched off, depending on the current system settings. Of course, such a situation may be unacceptable in some scenarios, thus it is beneficial to learn how to disable it. You will learn how to do it in this recipe.

As an example, you will prepare a page with the Toggle switching off button. After pressing it, the mechanism of switching off the screen will be disabled or enabled. To simplify your understanding of the current state, the background of the page will be changed to yellow when the mechanism of switching off the screen is disabled.

Getting ready

To step through this recipe, you only need the automatically generated project. ...

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