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