🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: if anyone can please help on how to deactivate/activate the windows screen saver

#9799
From: Andrue Cope [TeamB]
Date: Tue, 08 Jun 2004 12:44
30 lines
1833 bytes
peted@iinet.net.au wrote:

> I want to be able to call the exe with a parameter (on or off) and it
> disables/enables the screen saver without a reboot.
> 
> Can anyone suggest how to do this

The same question was asked by someone else a few hours ago. The answer
given was:

> Try this to activate
>     char sscr[MAX_PATH];
>     char WindowsDir[MAX_PATH];
>     GetWindowsDirectory(WindowsDir, MAX_PATH);
>     GetShortPathName(((AnsiString)WindowsDir + "\\" +
> SCREENSAVERNAME).c_str(), sscr, MAX_PATH);
>     WritePrivateProfileString("boot", "SCRNSAVE.EXE", sscr,
> "system.ini");     SystemParametersInfo(SPI_SETSCREENSAVEACTIVE,
> TRUE, NULL, 0);     SystemParametersInfo(SPI_SETSCREENSAVETIMEOUT,
> 60*StrToInt(Edit4->Text), NULL, 0);
> 
> and this to remove
>     WinExec("rundll32.exe desk.cpl,InstallScreenSaver (None)",
> SW_HIDE );
> Dave

-- 
Andrue Cope [Team]
[Bicester, Uk]
http://info.borland.com/newsgroups/guide.html
Technical Details
Message-ID: <40c5b4b6$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!logbridge.uoregon.edu!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
References: <kbabc0d5e6dh9hcbmiisplu57og19diqgc@4ax.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,94046ba0a106f56a
X-Google-Attributes: gid10cc67,public
From: "Andrue Cope [TeamB]" <no.spam@spammy.com>
Subject: Re: if anyone can please help on how to deactivate/activate the windows screen saver
Newsgroups: borland.public.cppbuilder.nativeapi
References: <kbabc0d5e6dh9hcbmiisplu57og19diqgc@4ax.com>
User-Agent: XanaNews/1.16.3.1
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
NNTP-Posting-Host: 217.207.223.34
Message-ID: <40c5b4b6$1@newsgroups.borland.com>
Date: 8 Jun 2004 05:44:38 -0700
X-Trace: newsgroups.borland.com 1086698678 217.207.223.34 (8 Jun 2004 05:44:38 -0700)
Lines: 30
X-Authenticated-User: acope
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!logbridge.uoregon.edu!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail