Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SystemParametersInfo
Message
From
19/02/1999 14:07:08
 
 
To
19/02/1999 13:54:00
Ray Watson
A Certified Electronics Co
Knoxville, Tennessee, United States
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00189403
Message ID:
00189414
Views:
13
>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.

Just a SWAG, but try setting liniparm to -1 instead of 1, so that all bits are set.
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform