VB with the closure of the screen protection

Author:Anonymous    Updated:2008-10-28 12:05:29
How to turn off ScreenSave function, to change the time Timeout

In addition, only hope that this change in the use of Windows when it (the next boot to restore the status quo), the final parameters changed SPIF_SENDWININICHANGE (not SPIF_UPDATEINIFILE)

Const SPI_SETSCREENSAVEACTIVE = 17
Const SPI_SETSCREENSAVETIMEOUT = 15
Const SPIF_SENDWININICHANGE = & H2
Const SPIF_UPDATEINIFILE = & H1

Private Declare Function SystemParametersInfo Lib \ "user32 \" Alias _
\ "SystemParametersInfoA \" (ByVal uAction As Long, ByVal uParam As Long, _
ByVal lpvParam As Long, ByVal fuWinIni As Long) As Long

Private Sub SetScreenSaveTimeout (ByVal BySecond As Long)
Call SystemParametersInfo (SPI_SETSCREENSAVETIMEOUT, BySecond, 0, _
SPIF_UPDATEINIFILE SPIF_SENDWININICHANGE)
End Sub

Private Sub EnableScreenSave ()
Call SystemParametersInfo (SPI_SETSCREENSAVEACTIVE, 1, 0, _
SPIF_UPDATEINIFILE SPIF_SENDWININICHANGE)
End Sub
Private Sub DisableScreenSave ()
Call SystemParametersInfo (SPI_SETSCREENSAVEACTIVE, 0, 0, _
SPIF_UPDATEINIFILE SPIF_SENDWININICHANGE)
End Sub
Previous:Visual Basic achievement of Office Assistant
Next:Vb at the tape to delete the folder in a folder
User Reviews
Site Search
Recommended article
AD