How to disable screensaver on Windows 7?

Hi
I use SDL 1.2.14 on windows 7,
I try add SDL_VIDEO_DISABLE_SCREENSAVER* but it didn’t work.*
Screensaver still started.
Does anyone have idea about this?
Greets

WS Liu

The source code comments in SDL_dibevents.c say:
/* Note that this doesn’t stop anything on Vista if the screensaver
has a password. */
so maybe that is your problem. Also, the WM_SYSCOMMAND method does not
seem to applicable for screensavers that use DirectX or OpenGL.

You could implement custom code based on this example:
http://support.microsoft.com/kb/126627
and it looks like Windows7 handles it just fine as per spec:
http://msdn.microsoft.com/en-us/library/ms724947(VS.85).aspx
but note that SPI_GETSCREENSAVEACTIVE is broken and needs extra code:
http://support.microsoft.com/kb/318781

Another solution would be to use SPI_SETBLOCKSENDINPUTRESETS to enable a
programatic reset of the screensaver by sending dummy mouse events via
SendInput() repeatedly in your game-loop.

Hope that helps,
–AndreasOn 10/29/10 12:14 AM, psboy wrote:

Hi
I use SDL 1.2.14 on windows 7,
I try add /SDL_VIDEO_DISABLE_SCREENSAVER//but it didn’t work./
/Screensaver still started./
/Does anyone have idea about this?/


Greets

WS Liu


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org