HELP - Is user's screen saver enabled??? 
Author Message
 HELP - Is user's screen saver enabled???

I'm under the gun to complete a multimedia viewer application and need help
quick.  If anybody can lend a hand, I would be extremely grateful.  
Using the SPI set screensaver function works fine - it is easy to enable
and disable the user's screen saver.  However, before I do that, I need to
determine if the user had their screensaver enabled.  According to the
knowledge base, the following should work.

Dim ScreenSaver As Boolean
Dim SystemReturn As Integer
Const SPI_GETSCREENSAVEACTIVE = 16

SystemReturn = SystemParametersInfo(SPI_GETSCREENSAVEACTIVE, 0,
ScreenSaver, 0)

This function is supposed to work with both Windows 95 and NT.  It should
load either true or false into 'ScreenSaver' (depending whether currently
enabled or not) and return a non-zero if the function was successful.
However,
it doesn't work.  No compile or runtime error. It just always returns a
zero and thus never loads a value into 'SystemReturn' (even though user's
screensaver is enabled).

Any ideas?

Thanks,
Dave Wilhelm



Sat, 16 Sep 2000 03:00:00 GMT  
 HELP - Is user's screen saver enabled???

Dave-
        I've seen this a couple of times now.
I've been thinking the same thing both times.
Why do you need to know if the screensaver is
enabled or not when you start.? Couldn't you just
disable it, no matter what? (Just don't modify the
permanent settings.) Then you change it back to
enabled when you're done. Your enabling of
the screensaver is not going to assign one if
there wasn't one assigned.  Maybe I'm not
seeing an obvious point. ( Probably the case...)
        Another approach- why not tell Win95/NT
that your app is a screensaver? That way the OS
won't try and start another SS.
Couple of SS examples-
http://www.arcatapet.com/vb.html
http://www.tiac.net/users/lvasseur/vb4ss.zip
                                        Joe
--
***********************************************************

Microsoft Developer MVP- Visual Basic
Check out Yankee Clipper Plus (April 1998
PCWorld magazine "Best Free Stuff Online")
www.tiac.net/users/lvasseur/ycphome.html
**********************************************************
PS- Please reply to the newsgroup- except in the
case of flames, insults, etc. (Don't bother.)



Quote:
> I'm under the gun to complete a multimedia viewer application and need
help
> quick.  If anybody can lend a hand, I would be extremely grateful.  
> Using the SPI set screensaver function works fine - it is easy to enable
> and disable the user's screen saver.  However, before I do that, I need
to
> determine if the user had their screensaver enabled.  According to the
> knowledge base, the following should work.

> Dim ScreenSaver As Boolean
> Dim SystemReturn As Integer
> Const SPI_GETSCREENSAVEACTIVE = 16

> SystemReturn = SystemParametersInfo(SPI_GETSCREENSAVEACTIVE, 0,
> ScreenSaver, 0)

> This function is supposed to work with both Windows 95 and NT.  It should
> load either true or false into 'ScreenSaver' (depending whether currently
> enabled or not) and return a non-zero if the function was successful.
> However,
> it doesn't work.  No compile or runtime error. It just always returns a
> zero and thus never loads a value into 'SystemReturn' (even though user's
> screensaver is enabled).

> Any ideas?

> Thanks,
> Dave Wilhelm



Sat, 16 Sep 2000 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Manipulate user's screen saver???

2. How do I disable/enable Screen Saver

3. Is the Screen Saver Enabled???

4. ListBox gray after screen saver was enabled...

5. Screen Saver on top of Screen Saver problem

6. Launching the screen saver help (why doesn't this work)

7. Screen saver 'preview window'?

8. Preventing a user from capturing a screen saver image

9. Screen saver user account?

10. Screen saver user account

11. Closing NT4's screen saver - contains code

12. VB5 app doesn't refresh correctly when screen saver has finished

 

 
Powered by phpBB® Forum Software