Re: Stop a running Screensaver .
- From: "Steve Yandl" <syandl_nospam@xxxxxxxxxxx>
- Date: Sun, 30 Apr 2006 10:36:31 -0700
Try this.
_____________________________________
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colProcesses = objWMIService.ExecQuery("Select * from Win32_Process")
For Each objProcess in colProcesses
If Right(objProcess.Name, 4) = ".scr" Then
objProcess.Terminate
End If
Next
____________________________________
Steve
"RAFAAJ2000" <RAFAAJ2000@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:AF9EFC66-7635-4BD1-9FB3-0A0ABD4AD179@xxxxxxxxxxxxxxxx
Hi,
I am trying to turnoff a screensaver as soon as it kicks off.
I know how to detect if a screen saver is currently running via
SPI_GETSCREENSAVERRUNNING but I can't seem to STOP it once it has kicked
off
programmatically.
I have tried simulating a Mouse Move or SendKey and even using the
SendMessage with the WM_CLOSE Msg but no luck !
Actually, I ma not sure about this, but it looks as if no code is executed
once the screensaver kicks off as the lines of code subsequent to the
screensaver starting don't execute !
I am doing this in an XL macro under XL2002 WIN XP.
Any help on this ?
Regards.
.
- Prev by Date: Re: VBA Calculation Error
- Next by Date: Re: simple question
- Previous by thread: Range Type Mismatch Excel vs Spread*** 9.0
- Next by thread: Test if value is between two numbers
- Index(es):