Results 1 to 3 of 3

Thread: Disable Screensaver

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jan 1999
    Location
    UK
    Posts
    26
    Any ideas how I disable a screen saver from working.

  2. #2
    New Member
    Join Date
    Jun 2000
    Posts
    11
    i haven't tried this but, would moving the mouse cursor every few minutes, using an API call or two work ?
    it's just a thought.

  3. #3
    Guest
    Code:
    'Author: Waty Thierry 
    'Origin:  http://www.geocities.com/ResearchTriangle/6311/
    'Purpose: Activate/Deactivate the Screen Saver
    'Version: VB4+ 
    
    Option Explicit
    Private Const SPI_SETSCREENSAVEACTIVE = 17
    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
    
    
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width