Re: Group policy screensaver - turn it off!

Tech-Archive recommends: Fix windows errors by optimizing your registry



Actually, I've just tried that code and it didn't work! Any other
ideas?

Cheers,

Chris




On Jun 5, 6:51 pm, chris_cul...@xxxxxxxxx wrote:
Hi,

I have a rather restricitve group policy set on my machine. I look
after a monte carlo simulation model, written in VBA, which annoying
breaks whenever the screensaver kicks in. They won't let me turn the
screensaver off. I have tried.

I have the following programming tools available:

1. VBA
2. Python compiler

and, er, that's it...

Does anyone know any vba hacks (or at a stretch a python hack) which
could stop my screensaver locking every 15 minutes, breaking my model?

I don't care how it does it - simulate a mouse movement, type a key,
turn the screensaver off... anything - it's becoming desperate!

I found the following in this newsgroup, but not sure it would work
with a group policy screensaver (Don Bardner, original author)...

Private Declare Function SystemParametersInfo Lib "user32" Alias _
"SystemParametersInfoA" (ByVal uAction As Long, ByVal uParam As Long,
_
lpvParam As Any, ByVal fuWinIni As Long) As Long

Sub SetScreenSaver(OnOff As Long)
'From Don Bradner
Dim templong As Long
Const SPI_SETSCREENSAVEACTIVE = 17
Const SPIF_UPDATEINIFILE = 1
Const SPIF_SENDWININICHANGE = 2
templong = SystemParametersInfo(SPI_SETSCREENSAVEACTIVE, OnOff,
ByVal
0&, _
SPIF_UPDATEINIFILE Or SPIF_SENDWININICHANGE)
End Sub

Sub MySub()
SetScreenSaver 0
'your code here
SetScreenSaver 1
End Sub


.



Relevant Pages

  • Re: Group policy screensaver - turn it off!
    ... how will the OP have permission to those keys? ... I have a rather restricitve group policy set on my machine. ... breaks whenever the screensaver kicks in. ... Const SPI_SETSCREENSAVEACTIVE = 17 ...
    (microsoft.public.excel.programming)
  • Re: Group policy screensaver - turn it off!
    ... Dim WSHShell, regVal ... breaks whenever the screensaver kicks in. ... Sub SetScreenSaver ... Const SPI_SETSCREENSAVEACTIVE = 17 ...
    (microsoft.public.excel.programming)
  • Re: Group policy screensaver - turn it off!
    ... I suspect that the same group policy will ... will prevent your screensaver from kicking in. ... Const SPI_SETSCREENSAVEACTIVE = 17 ... SetScreenSaver 0 ...
    (microsoft.public.excel.programming)
  • Re: Group policy screensaver - turn it off!
    ... I'm thinking of resorting to a hardware solution - having a rotating ... debug prevents the ScreenSaver kicking in. ... Private Sub CommandButton1_Click ... Const SPI_SETSCREENSAVEACTIVE = 17 ...
    (microsoft.public.excel.programming)
  • Re: Group policy screensaver - turn it off!
    ... debug prevents the ScreenSaver kicking in. ... Dim starttime As Date ... I suspect that the same group policy will ... Const SPI_SETSCREENSAVEACTIVE = 17 ...
    (microsoft.public.excel.programming)