SPI wount set!! please help! 
Author Message
 SPI wount set!! please help!

Why cant I set the screensaver timeout and active?
I'v tried everything but can't get it to work.

code:
ret = SystemParametersInfo(SPI_SETSCREENSAVEACTIVE, False, vbNull, 0)

It returns zero which should be an error. The spi_get action works fine
but not the set ones...
--




Mon, 19 Nov 2001 03:00:00 GMT  
 SPI wount set!! please help!
Hi BumbyBear,
    The API call and the parameters u r using r absolutely fine. Since u day
that it returns zero, the only way to get some more info on the error is to
use the GetLastError call.

Hope this helps u
regards,
Prasanna


Quote:
> Why cant I set the screensaver timeout and active?
> I'v tried everything but can't get it to work.

> code:
> ret = SystemParametersInfo(SPI_SETSCREENSAVEACTIVE, False, vbNull, 0)

> It returns zero which should be an error. The spi_get action works fine
> but not the set ones...
> --





Mon, 19 Nov 2001 03:00:00 GMT  
 SPI wount set!! please help!

Check the documentation on SystemParametersInfo.
First your example would turn it OFF. You need non-zero in the 2nd
argument to turn it ON. Secondly, SET operations require both
SPIF_UPDATEINIFILE and SPIF_SENDWININICHANGE flags in the fWinIni
argument for changes to take effect immediately and stick. Also note
that SPI_SETSCREENSAVEACTIVE will not run the screensavers immediately
(a common mis-conception). It merely enables them so they'll run
normally when the timeout expires.
Ex:
Private Const SPI_SETSCREENSAVEACTIVE = 17
Private Const SPIF_UPDATEINIFILE = &H1
Private Const SPIF_SENDWININICHANGE = &H2
Private Declare Function SystemParametersInfo Lib "user32" Alias
"SystemParametersInfoA" (ByVal uAction As Long, ByVal uParam As Long,
lpvParam As Any, ByVal fuWinIni As Long) As Long

Usage:
    lRet = SystemParametersInfo(SPI_SETSCREENSAVEACTIVE, 1&, ByVal 0&,
SPIF_UPDATEINIFILE Or SPIF_SENDWININICHANGE)

On Thu, 03 Jun 1999 11:16:08 +0200, BumbyBear

Quote:

>Why cant I set the screensaver timeout and active?
>I'v tried everything but can't get it to work.

>code:
>ret = SystemParametersInfo(SPI_SETSCREENSAVEACTIVE, False, vbNull, 0)

>It returns zero which should be an error. The spi_get action works fine
>but not the set ones...
>--



-Tom
(remove gibberish for e-mail repl)


Mon, 19 Nov 2001 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. SPI wount set!!! HELP!

2. PLEASE HELP, PLEASE HELP, PLEASE HELP, PLEASE HELP, PLEASE HELP, PLEASE HELP, PLEASE HELP,

3. Can anyone HELP me PLEASE PLEASE PLEASE PLEASE PLEASE PLEASE PLEASE PLEASE PLEASE

4. VB4 (32bit) app wount run

5. PLEASE HELP PLEASE HELP PLEASE HELP

6. Windows API call to set windows colors (HELP Please)

7. Please help : Word acts strange when its object is set to invisible

8. Please help with error: Object reference not set to an instance of an object

9. Problem Setting RecordSource - Please Help

10. Help please - trying to determine character set

11. Object variable or With block variable not set (Error 91) Please Help

12. Setting variable = to MSComm control...please help

 

 
Powered by phpBB® Forum Software