🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.cppbuilder.nativeapi
5 messages
5 total messages Started by Jacob Mortensen Sun, 30 Mar 2003 15:33
Activating the screen saver or power down the screen
#17231
Author: Jacob Mortensen
Date: Sun, 30 Mar 2003 15:33
12 lines
1136 bytes
Hi all,

Is there some way to activate the screen saver or to activate the Energy
Saving function; Power off monitor.



I would appreciate if I was able to power down my monitor when I leave the
PC.

Thanks
Jacob
Re: Activating the screen saver or power down the screen
#17259
Author: Vladimir Afanasyev
Date: Tue, 01 Apr 2003 11:12
21 lines
1475 bytes
Hi Jacob,

"Jacob Mortensen" <jacob.mortensen@mail.dk> wrote:
>Hi all,
>
>Is there some way to activate the screen saver or to activate the Energy
>Saving function; Power off monitor.
>

You can activate Screen Saver via ShellExecute Win32 API 
function:


ShellExecute(GetDesktopWindow(),
"open","\"C:\\WINNT\\SysInternals Bluescreen.scr\""," /S",
    "C:\\",SW_SHOW);

This way should work (in my opinion) for Win98/Me/NT4/2000/XP.

Vladimir.
Re: Activating the screen saver or power down the screen
#17269
Author: Remy Lebeau (TeamB)
Date: Tue, 01 Apr 2003 18:52
17 lines
1644 bytes
"Vladimir Afanasyev" <avv@systema.kiev.ua> wrote in message
news:3e897418$1@newsgroups.borland.com...

> This way should work (in my opinion) for Win98/Me/NT4/2000/XP.

Not if you hard-code a path like that :-p  You would need to first call
GetWindowsDirectory() to determine where the Windows folder actually is, and
build up the path dynamically.

Also note that under Win9x/Me, at least, the screensaver filename is stored
in SYSTEM.INI, so you could read that value as well to ensure you're
actually starting the user's own configured screensaver.  I'm not sure where
NT/2K/XP stores it's configuration value, though.


Gambit
Re: Activating the screen saver or power down the screen
#17267
Author: Remy Lebeau (TeamB)
Date: Tue, 01 Apr 2003 18:53
12 lines
1447 bytes
"Remy Lebeau (TeamB)" <gambit47@yahoo.com> wrote in message
news:3e89dfd7$2@newsgroups.borland.com...

> I'm not sure where NT/2K/XP stores it's configuration value, though.

Which, btw, ShellExecute() won't work on NT/2K/XP for this, anyway, because
those OSs run the ScreenSaver under a completely separate desktop of its
own, so there is extra processing involved in executing screensavers.


Gambit
Re: Activating the screen saver or power down the screen
#17185
Author: Vladimir Afanasyev
Date: Wed, 02 Apr 2003 07:07
24 lines
1937 bytes
Hi,

"Remy Lebeau \(TeamB\)" <gambit47@yahoo.com> wrote:
>
>"Remy Lebeau (TeamB)" <gambit47@yahoo.com> wrote in message
>news:3e89dfd7$2@newsgroups.borland.com...
>
>> I'm not sure where NT/2K/XP stores it's configuration value, though.
>
>Which, btw, ShellExecute() won't work on NT/2K/XP for this, anyway, because
>those OSs run the ScreenSaver under a completely separate desktop of its
>own, so there is extra processing involved in executing screensavers.
>

In both case (Win98, 2000) screen saver was run.
Besides these for Win98 it was not in Windows directory so 
probably not registered as Screen Saver.

But may be you right that was executed but not executed as 
screen saver - password dialog was not called.
But it is enoughly clear emulate the work of screen saver.
Do you try those code?
Vladimir.
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads