Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Disabling a screen saver
Message
 
À
23/04/1998 10:56:22
Ray Watson
A Certified Electronics Co
Knoxville, Tennessie, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00093980
Message ID:
00094328
Vues:
29
>Hi George,
>
>I tried the following code to test the enable/disable of the sceen saver. The last call to SystemParameterInfo returns .F. and the screen saver state is not changed.
>
>What did I do wrong?
>
>Thanks,
>
>Ray
>
>#DEFINE GETSCREENSAVEACTIVE 16
>#DEFINE SETSCREENSAVER 17
>DECLARE SHORT SystemParametersInfo IN WIN32API ;
> INTEGER uiAction, SHORT uiParam, ;
> INTEGER @pvParam, INTEGER fWinIni
>
>lnvparm = 0
>? (SystemParametersInfo(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(SETSCREENSAVER,liniparm,0,0) # 0)

Ray,

Take a look at the difference between the two declarations. In the first, the lnvparm is declared and passed by reference, in the second it's declared and passed by value. The behavior that you describe is exactly the same as I encountered. The only way around (I found was the separate declarations).

Let me know how this goes.
George

Ubi caritas et amor, deus ibi est
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform