|
-
Jul 18th, 2006, 04:32 AM
#1
Thread Starter
Hyperactive Member
[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?
-
Jul 18th, 2006, 04:43 AM
#2
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 ?
-
Jul 18th, 2006, 05:43 AM
#3
Thread Starter
Hyperactive Member
Re: Determine if ScreenSaver is running?
-
Jul 18th, 2006, 05:48 AM
#4
Thread Starter
Hyperactive Member
Re: [RESOLVED] Determine if ScreenSaver is running?
for the sake of readers:
VB Code:
Private Const SPI_SETSCREENSAVEACTIVE = 17
Private Const SPI_SETSCREENSAVETIMEOUT = 15
Private Const SPI_GETSCREENSAVETIMEOUT = 14
Private Const SPIF_SENDWININICHANGE = &H2
Private Const SPIF_UPDATEINIFILE = &H1
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
Public Function SSon() As Long 'returns 0 is Screen Saver is off
Dim result As Long
SystemParametersInfo 16, 0, result, 0
SSon = result
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|