Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Disabling a screen saver
Message
 
À
22/04/1998 11:46:24
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:
00094288
Vues:
24
>Thanks to all!
>Ray

I think that the easiest way to do what you want is via the SystemParametersInfo() function. I found that it's a bit tricky, however, to get it to do exactly what you want. In order to get it to work, the declaration is slightly different depending on what you want it to do. In order to retrieve the current status, you need the following:
#DEFINE SPI_GETSCREENSAVEACTIVE    16
DECLARE SHORT SystemParametersInfo IN Win32API;
  INTEGER uiAction, SHORT uiParam,;
  INTEGER @pvParam, INTEGER fWinIni
lnvparm = 0
llsuccess = (SystemParametersInfo(SPI_GETSCREENSAVEACTIVE, 0, @lnvparm, 0) # 0)
If the function succeeds (and it should), lnvparm will equal 1 (Active) or 0 (Inactive). In order to disable the screen saver, you need:
#DEFINE SPI_SETSCREENSAVEACTIVE    17
DECLARE SHORT SystemParametersInfo IN Win32API;
  INTEGER uiAction, SHORT uiParam,;
  INTEGER pvParam, INTEGER fWinIni
lniparm = 0
llsuccess = (SystemParametersInfo(SPI_SETSCREENSAVEACTIVE, lniparm, 0, 0) # 0)
To activate the screen saver, if it's been disabled, set liniparm equal to 1.

Thanks to Donald, who got me looking at this function.

hth,
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