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!
- Avoid These 12 Mistakes Companies Make on Their First Payment Kiosk - April 6, 2019
- 6 Tips for Boosting Customer Engagement at Your Kiosks - March 23, 2019
- How to Create a Customer Survey Kiosk - November 8, 2017