VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Deactivate the Screen Saver

by Jonathan Valentin (5 Submissions)
Category: Windows System Services
Compatability: Visual Basic 5.0
Difficulty: Unknown Difficulty
Originally Published: Sun 18th June 2000
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Deactivate the Screen Saver

API Declarations


Private Const SPIF_UPDATEINIFILE = &H1
Private Const SPIF_SENDWININICHANGE = &H2

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

Rate Deactivate the Screen Saver



Public Function ToggleScreenSaverActive(Active As Boolean) _
   As Boolean

'To Activate Screen Saver, set active to true
'to deactivate, set active to false

Dim lActiveFlag As Long
Dim retval As Long

lActiveFlag = IIf(Active, 1, 0)
retval = SystemParametersInfo(SPI_SETSCREENSAVEACTIVE, _
   lActiveFlag, 0, 0)
ToggleScreenSaverActive = retval > 0

End Function


Download this snippet    Add to My Saved Code

Deactivate the Screen Saver Comments

No comments have been posted about Deactivate the Screen Saver. Why not be the first to post a comment about Deactivate the Screen Saver.

Post your comment

Subject:
Message:
0/1000 characters