Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SystemParametersInfo
Message
 
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:
00189437
Views:
11
Hi Ray,

You are assuming that the return value is the setting. It is not, the returned value is whether the call was successfull or not.

The setting you are looking for is on the 3rd parameter. I've also changed the uiparm from a SHORT to an integer so that you can pass a logical and not a number.

#DEFINE SPI_GETSCREENSAVEACTIVE 16
#DEFINE SPI_SETSCREENSAVEACTIVE 17

DECLARE SHORT SystemParametersInfo IN WIN32API ;
INTEGER uiAction,;
INTEGER uiParam, ;
INTEGER @pvParam,;
INTEGER fWinIni


lnvparm = 0
m.lRetVal = (SystemParametersInfo(SPI_GETSCREENSAVEACTIVE,0, @lnvparm, 0) # 0)

IF lnvparm = 0
liniparm = .T.
? "Screen saver is being enabled"
ELSE
liniparm = .F.
? "Screen saver is being disabled"
ENDIF

lnvparm = 0
m.lRetVal = (SystemParametersInfo( SPI_SETSCREENSAVEACTIVE, liniparm, @lnvparm, 0) # 0)
? lnvparm

Good luck
Juan L. Romero
gcandela@javanet.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform