🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #3257

Re: Screen Saver

#3257
From: Remy Lebeau (TeamB)
Date: Thu, 10 Aug 2006 06:48
26 lines
1886 bytes
"M J Heneghan" <mjheneghan@ntlworld.com> wrote in message
news:44dacfb0$1@newsgroups.borland.com...

>  bool *IsScreenSave;
>  SystemParametersInfo(SPI_GETSCREENSAVEACTIVE, 0, IsScreenSave, 0);

That is not the correct way to pass the boolean.  You have to use the '&'
operator instead:

    BOOL IsScreenSave;
    SystemParametersInfo(SPI_GETSCREENSAVEACTIVE, 0, &IsScreenSave, 0);

> however, the screensaver still kicks in.

As it should be.  You are not preventing it from running at all.
SPI_SETSCREENSAVEACTIVE does not deactive the screensaver if it is already
running.  It is only a flag to tell the OS whether the screensaver is
running or not.  Screensavers use SPI_SETSCREENSAVEACTIVE when they run.  If
anything, you should be setting SPI_SETSCREENSAVEACTIVE to TRUE instead of
FALSE to trick the OS into thinking a screensaver is running when none
actually is.  That way, the actual screen saver will not kick in until you
set SPI_SETSCREENSAVEACTIVE back to FALSE later.


Gambit
Technical Details
Message-ID: <44dae467$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <44dacfb0$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,daf9a6c110c41bce
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Remy Lebeau \(TeamB\)" <no.spam@no.spam.com>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <44dacfb0$1@newsgroups.borland.com>
Subject: Re: Screen Saver
Date: Wed, 9 Aug 2006 23:48:00 -0700
Lines: 28
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1409
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409
NNTP-Posting-Host: 68.69.17.41
Message-ID: <44dae467$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1155196007 68.69.17.41 (10 Aug 2006 00:46:47 -0700)
Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail