Public Function ToggleScreenSaverActive(Active As Boolean) _
As Boolean
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