flat assembler
Message board for the users of flat assembler.

Index > Windows > How do you disable screensaver in code?

Author
Thread Post new topic Reply to topic
ShortCoder



Joined: 07 May 2004
Posts: 105
ShortCoder 22 Aug 2004, 18:35
It is very unfortunate that the win32asmboard has been hijacked or I would have posted this there, first, as it is most specifically a Windows topic.

Since it's not, I'll post here in this subsection:)

Has anyone else had the annoyance of using a program which uses exclusively the joystick as an input device, while in windows, and then had either the screen saver kick in or else had the black screen effect kick in? (Seriously, if you disable the screen saver, then Windows seems to think it knows "best" and so displays a black screen after a certain amount of time if you haven't a screensaver to "save" your screen)

The problem is, obviously, Windows is too stupid to realize that a joystick IS a user-interactive input device and that, if the user is using the joystick, that, YES, there is user-interaction taking place and so, therefore, DO NOT screensave.

Since Windows doesn't do this, I was wondering if there was any way to code a program such that it disables both the Windows screensaver and the black screen effect. Obviously, I wouldn't want to code a game that uses joystick and then have someone playing it and they die or whatever because the stupid screensaver kicked in! (or black screen)

This is a Windows annoyance but, clearly, I would like to program around it.

_________________
Boycott Symantec/Norton/PowerQuest whenever possible
Post 22 Aug 2004, 18:35
View user's profile Send private message Reply with quote
coconut



Joined: 02 Apr 2004
Posts: 326
Location: US
coconut 22 Aug 2004, 19:42
you can manually disable screen saver and monitor turning off (power-saving feature) in windows. what version are you running?
Post 22 Aug 2004, 19:42
View user's profile Send private message Reply with quote
mike.dld



Joined: 03 Oct 2003
Posts: 235
Location: Belarus, Minsk
mike.dld 22 Aug 2004, 20:17
You can't disable it (probably) but you may say Windows that it's already running so it won't turn it on. Use SystemParametersInfo with SPI_SETSCREENSAVEACTIVE. Alternatively, you may use that function to set timeout for the screensaver (e.g. to -1, if it's long enough for you) with SPI_SETSCREENSAVETIMEOUT
Post 22 Aug 2004, 20:17
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
ShortCoder



Joined: 07 May 2004
Posts: 105
ShortCoder 23 Aug 2004, 19:17
Thanks mike. I think the SPI_SETSCREENSAVEACTIVE thing is exactly what I need--I need to try that sometime.Smile

coconut, no, I want to know how to do this in my own software so that if someone else was using it on his or her computer and using only joystick, that the screensaver wouldn't pop in on them and annoy.Wink It is one matter to manually change things for your own machine but I want this automated so that other people don't HAVE to manually do it--get it?

_________________
Boycott Symantec/Norton/PowerQuest whenever possible
Post 23 Aug 2004, 19:17
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.