In this article I’ll explain how to temporarily disable the built in Windows screen saver from your kiosk application. If you’ve created a native Windows application (i.e. .NET WPF) to run on your self-service kiosk you probably don’t want it to be interrupted by the Windows screen saver. Sure you could go to the screen saver settings and disable the screen saver completely but then you’d have to do that on ever single kiosk. It would be more convenient to temporarily disable the screen saver only while your kiosk application is running.
Fortunately Microsoft has included support for disabling the Windows screen saver via the SetThreadExecutionState function.
By defining a timer in your kiosk application that periodically calls SetThreadExecutionState and passes in the display required attribute it forces the display idle timer to be reset and the display to stay on. This ensures that the Windows screen saver will be temporarily disabled regardless of the screen saver settings and the kiosk display will always stay on.
SetThreadExecutionState(EXECUTION_STATE.ES_DISPLAY_REQUIRED); // Keep display on
When your kiosk application is closing you should call SetThreadExecutionState one last time and pass the continuous attribute to allow the kiosk display to go idle again.
SetThreadExecutionState(EXECUTION_STATE.ES_CONTINUOUS); // Allow display to go idle again
This functionality is built into KioskSimple if you don’t want to roll your own. KioskSimple also prevents your kiosk from sleeping/hibernating and blocks system keystrokes like Ctrl-Alt-Del and generally secures your kiosk application. Try an a free demo of KioskSimple today!
- Kiosk Idle Timeout: What Happens When They Walk Away… - May 25, 2019
- How to Plan Your Payment Kiosk Workflow - May 4, 2019
- Selecting Kiosk Payment Devices, Don’t Paint Yourself into A Corner - April 25, 2019