screen saver issue

Windows specific questions.
Post Reply
nedman47
Posts: 62
Joined: Dec 05, 2006 15:35

screen saver issue

Post by nedman47 »

I was writing a program to run all the time and display results in a small window. I noticed it was preventing the Windows 7 screen saver from starting. I whittled it down to this:

Code: Select all

screen 13
sleep
Something is going on with SCREEN. I'm just curious as to what it could be?
MrSwiss
Posts: 3910
Joined: Jun 02, 2013 9:27
Location: Switzerland

Re: screen saver issue

Post by MrSwiss »

I don't think that it is related to screen, sleep seems to be more likely.
But it may be that the reason is somewhere else entirely.
Screen saver disabled in the setup? ... just guessing

Preventing PC from going to sleep, thus suspending the running program, maybe?
nedman47
Posts: 62
Joined: Dec 05, 2006 15:35

Re: screen saver issue

Post by nedman47 »

I thought it was sleep at first but have ruled that out by experiment. I've tried a couple of windows message monitoring programs and it seems that the fbgfx library is sending windows messages multiple times per second.
dkl
Site Admin
Posts: 3235
Joined: Jul 28, 2005 14:45
Location: Germany

Re: screen saver issue

Post by dkl »

I've just looked into the FB gfxlib2 source code and the reason seems simple:

The FB graphics library turns the screen saver off when the Screen is initialized (and restores the state when its closed).

Code: Select all

int fb_hWin32Init(....) {
...
SystemParametersInfo(SPI_SETSCREENSAVEACTIVE, FALSE, NULL, 0);
...
}
I guess it makes sense for game development...
nedman47
Posts: 62
Joined: Dec 05, 2006 15:35

Re: screen saver issue

Post by nedman47 »

I was able to turn the screen saver back on using a systemparametersinfo call after screenres had turned it off.

Thanks!
Post Reply