G
Guest
I'm using a SystemParametersInfo call to attempt to manage the screen saver.
All I want to do is modify the ScreenSaveActive bit in the registry and have
the OS recognize it (and occasionally set it back to -0-). Theoretically this
should be easy to accomplish through the call shown below. If I trace the
call with SysInternals (si)Registry Monitor I can see the call being made.
Unfortunately in the si QueryValue for the key
HKCU\Software\Policies\Microsoft\Windows\Control
Panel\Desktop\ScreenSaveActive I'm getting a result of BUFOVRFLOW (which I
assume is the trace tool unable to read the value). The value in the registry
does not change.
We do have a forced screen saver GPO applied which I suspect may be causing
the failure. I have checked registry permissions and all is ok on this key.
I've used the SPIF_SENDWININICHANGE parameter with no luck. The following
call is about as basic as I can get for troubleshooting this problem. Any
ideas?
VB.net 1.1, Win2KPro (and XPPro) Also tried C++6.0 and VB6.0.
VB.net call
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
Private Function SetScreenSaver(ByVal Active As Boolean) As Long
Dim lActiveFlag As Long = 0
If Active = True Then lActiveFlag = 1
Return = SystemParametersInfo(SPI_SETSCREENSAVEACTIVE, lActiveFlag, 0, 0)
End Function
-Mike
All I want to do is modify the ScreenSaveActive bit in the registry and have
the OS recognize it (and occasionally set it back to -0-). Theoretically this
should be easy to accomplish through the call shown below. If I trace the
call with SysInternals (si)Registry Monitor I can see the call being made.
Unfortunately in the si QueryValue for the key
HKCU\Software\Policies\Microsoft\Windows\Control
Panel\Desktop\ScreenSaveActive I'm getting a result of BUFOVRFLOW (which I
assume is the trace tool unable to read the value). The value in the registry
does not change.
We do have a forced screen saver GPO applied which I suspect may be causing
the failure. I have checked registry permissions and all is ok on this key.
I've used the SPIF_SENDWININICHANGE parameter with no luck. The following
call is about as basic as I can get for troubleshooting this problem. Any
ideas?
VB.net 1.1, Win2KPro (and XPPro) Also tried C++6.0 and VB6.0.
VB.net call
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
Private Function SetScreenSaver(ByVal Active As Boolean) As Long
Dim lActiveFlag As Long = 0
If Active = True Then lActiveFlag = 1
Return = SystemParametersInfo(SPI_SETSCREENSAVEACTIVE, lActiveFlag, 0, 0)
End Function
-Mike