Article View: borland.public.cppbuilder.nativeapi
Article #9920Re: How to enable/disable screen saver from a BCB6 application on a WinXP?
From: Dave
Date: Mon, 07 Jun 2004 10:06
Date: Mon, 07 Jun 2004 10:06
20 lines
1637 bytes
1637 bytes
On Mon, 7 Jun 2004 19:28:00 +1000, <Tomas> wrote:
> How to enable/disable screen saver from a BCB6 application on a WinXP?
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 );
Hope it helps,
Dave
Technical Details
Message-ID:
<y33okxofnhu7$.1w1nk8j3plb53.dlg@40tude.net>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!colt.net!peernews3.colt.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<40c43520@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,f9f8789ec2f090f6 X-Google-Attributes: gid10cc67,public From: Dave <dave_xse@nospam.org> Subject: Re: How to enable/disable screen saver from a BCB6 application on a WinXP? Newsgroups: borland.public.cppbuilder.nativeapi User-Agent: 40tude_Dialog/2.0.10.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit References: <40c43520@newsgroups.borland.com> Date: Mon, 7 Jun 2004 12:06:12 +0200 Message-ID: <y33okxofnhu7$.1w1nk8j3plb53.dlg@40tude.net> NNTP-Posting-Host: 80.218.152.5 X-Trace: newsgroups.borland.com 1086602771 80.218.152.5 (7 Jun 2004 03:06:11 -0700) Lines: 20 Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!colt.net!peernews3.colt.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail