>Hi,
>When I use SystemParametersInfo to GET system parameters everything is OK, but when I try to SET a parameter the functions fail???
>
>Win98 OS
>TIA
>Ray
>(code follows)
>
>
>#DEFINE SPI_GETSCREENSAVEACTIVE 16
>#DEFINE SPI_SETSCREENSAVEACTIVE 17
>
>DECLARE SHORT SystemParametersInfo IN WIN32API ;
> INTEGER uiAction, SHORT uiParam, ;
> INTEGER @pvParam, INTEGER fWinIni
>
>lnvparm = 0
>? (SystemParametersInfo(SPI_GETSCREENSAVEACTIVE,0, @lnvparm,0) # 0)
>
>IF lnvparm = 0
> liniparm = 1 && Enable Screen saver
> ? "Screen saver is being enabled"
>ELSE
> liniparm = 0 && Disable Screen Saver
> ? "Screen saver is being disabled"
>ENDIF
>
>? (SystemParametersInfo(SPI_SETSCREENSAVEACTIVE,liniparm,0,0) # 0)
>
>
>Output----------------------
>.T.
>Screen saver is being disabled
>.T.
>
>Should be--------------------
>.T.
>Screen saver is being disabled
>.F.
Ray,
The declares for getting and setting have to be slightly different. Take a look at my Enable/Disable Screen Saver class (in the download section under Classes). I think you might find it'll do exactly what you're looking for.
hth,
George
Ubi caritas et amor, deus ibi est