Important screensaver tip for Windows emulator authors
Moderator: Moderators
Re: Important screensaver tip for Windows emulator authors
cool -- just tested the Power Management API and it seems to work well. Even with my workstation set to lock. Thanks!
get nemulator
http://nemulator.com
http://nemulator.com
Re: Important screensaver tip for Windows emulator authors
Another Win32 function I didn't see mentionned on this thread is SetThreadExecutionState, which is compatible with Windows XP and newer.
You can call it periodically like this: to reset the sleep timer and the screen blanking/screensaver timer, or you can use the ES_CONTINUOUS flag to make the setting stick.
will disable windows sleep and the screensaver, while will re-enable them.
You can call it periodically like this:
Code: Select all
SetThreadExecutionState(ES_DISPLAY_REQUIRED | ES_SYSTEM_REQUIRED)
Code: Select all
SetThreadExecutionState(ES_CONTINUOUS | ES_DISPLAY_REQUIRED | ES_SYSTEM_REQUIRED)
Code: Select all
SetThreadExecutionState(ES_CONTINUOUS)