screen saver issue

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

screen saver issue

Postby nedman47 » Oct 12, 2015 14:05

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: 3569
Joined: Jun 02, 2013 9:27
Location: Switzerland

Re: screen saver issue

Postby MrSwiss » Oct 12, 2015 16:45

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

Postby nedman47 » Oct 12, 2015 17:18

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: 3212
Joined: Jul 28, 2005 14:45
Location: Germany

Re: screen saver issue

Postby dkl » Oct 12, 2015 19:43

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

Postby nedman47 » Oct 13, 2015 12:26

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

Thanks!

Return to “Windows”

Who is online

Users browsing this forum: No registered users and 1 guest