Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SystemParametersInfo
Message
 
À
19/02/1999 13:54:00
Ray Watson
A Certified Electronics Co
Knoxville, Tennessie, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00189403
Message ID:
00189437
Vues:
10
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform