I would to request the ability for Kodi for Windows to optionally prevent the windows screen saver from turning on when Kodi is running. This would prevent conflicts between Kodi’s built-in screen saver and the Windows screen saver while still allowing the windows screen saver to remain active and functional when Kodi is not running.
This could be handed by the SetThreadExecutionState call.
http://www.pinvoke.net/default.aspx/kern…utionstate
[DllImport("kernel32.dll")]
static extern EXECUTION_STATE SetThreadExecutionState(EXECUTION_STATE esFlags);
[FlagsAttribute]
enum EXECUTION_STATE : uint
{
ES_AWAYMODE_REQUIRED = 0x00000040,
ES_CONTINUOUS = 0x80000000,
ES_DISPLAY_REQUIRED = 0x00000002,
ES_SYSTEM_REQUIRED = 0x00000001
}
To prevent the windows screen saver from starting:
SetThreadExecutionState(EXECUTION_STATE.ES_DISPLAY_REQUIRED | EXECUTION_STATE.ES_CONTINUOUS);
To re-enable the windows screen saver when Kodi exists:
SetThreadExecutionState(EXECUTION_STATE.ES_DISPLAY_REQUIRED | EXECUTION_STATE.ES_CONTINUOUS);