Results 1 to 4 of 4

Thread: [RESOLVED] Determine if ScreenSaver is running?

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2006
    Posts
    372

    Resolved [RESOLVED] Determine if ScreenSaver is running?

    How does one do that?
    i need to tell if a workstation is vacant.
    Now using a complicated patchwork of last input api, and system idletime through WMI, and i would like one more evaluation: is the screen saver running?

    with just the first two, i get false positives if a low-cpu app like an NES emulator is running, using USB controllers.
    but if the screensaver is on, they aren't playing any games...

    any ideas?

  2. #2
    Fanatic Member schoolbusdriver's Avatar
    Join Date
    Jan 2006
    Location
    O'er yonder
    Posts
    1,020

    Re: Determine if ScreenSaver is running?

    I don't have a working example or know how you'd do it over a network but how about the SystemParametersInfo function with the SPI_GETSCREENSAVERRUNNING as the first parameter ?

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2006
    Posts
    372

    Re: Determine if ScreenSaver is running?

    thanks sbd!

  4. #4

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2006
    Posts
    372

    Re: [RESOLVED] Determine if ScreenSaver is running?

    for the sake of readers:

    VB Code:
    1. Private Const SPI_SETSCREENSAVEACTIVE = 17
    2. Private Const SPI_SETSCREENSAVETIMEOUT = 15
    3. Private Const SPI_GETSCREENSAVETIMEOUT = 14
    4. Private Const SPIF_SENDWININICHANGE = &H2
    5. Private Const SPIF_UPDATEINIFILE = &H1
    6.  
    7. Public Declare Function SystemParametersInfo Lib "user32" Alias "SystemParametersInfoA" (ByVal uAction As Long, ByVal uParam As Long, ByRef lpvParam As Any, ByVal fuWinIni As Long) As Long
    8.      
    9.  
    10. Public Function SSon() As Long 'returns 0 is Screen Saver is off
    11.     Dim result As Long
    12.     SystemParametersInfo 16, 0, result, 0
    13.     SSon = result
    14. 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