|
-
Apr 28th, 2006, 02:59 PM
#1
Thread Starter
Member
Stop A Running Screen Saver Programmatically !
Hi all,
I am running a lenghthy loop and I want to PREVENT the screen saver from running during the time the loop is being excecuted.
I can detect when the screen saver kicks off but I can't seem to disable it as soon as that happens.
I have tried many things including SendKeys and Mouse move evnts, setcursorPos ....to emulate an action but without any luck !
this is waht I have so far but the "SPI_SETSCREENSAVERRUNNING" doesn't work !
Code:
VB Code:
Declare Function SystemParametersInfo Lib "user32" Alias _
"SystemParametersInfoA" (ByVal uAction As Long, ByVal uParam As Long, _
ByRef lpvParam As Long, ByVal fuWinIni As Long) As Long
Const SPI_SETSCREENSAVERRUNNING As Long = 97
Const SPI_GETSCREENSAVERRUNNING As Long = &H72
Public Sub TEST()
Dim lngIsRunning As Long
Do
SystemParametersInfo SPI_GETSCREENSAVERRUNNING, vbNull, lngIsRunning, vbNull
If CBool(lngIsRunning) Then
'THIS DOESN'T DISABLE SCREEN SAVER !
SystemParametersInfo SPI_SETSCREENSAVERRUNNING, 0, 0, 0
Exit Do
End If
Loop
MsgBox "FINISH"
End Sub
I have even used different SenMessage commands but nothing disables the screen saver !
FYI, I am using WIN XP.
ANY HELP PLEASE ?
THANK YOU.
-
Apr 28th, 2006, 05:50 PM
#2
-
Apr 29th, 2006, 04:49 AM
#3
Thread Starter
Member
Re: Stop A Running Screen Saver Programmatically !
Thanks Manavo but that link doesn't answer my question
I don't want to install or uninstall a screensaver, I want to unload it as soon as it kicks off just like when the mouse is moved or a key pressed by the user.
I hope I have explained this clearly.
FYI, emulating a mouse move via the mouse_event or SetCursorPos APIs or even SendKey don't seem to work !
Anyone has a solution to this one ?
Regards.
-
May 2nd, 2006, 03:31 PM
#4
-
May 2nd, 2006, 04:20 PM
#5
Frenzied Member
Re: Stop A Running Screen Saver Programmatically !
Try api SendInput() to emulate keystroke.
-
May 17th, 2006, 12:18 PM
#6
Addicted Member
Re: Stop A Running Screen Saver Programmatically !
May be I am being naive here. But what wait till the screen saver starts off? How about putting a timer with an interval of 5 minutes or so and simulating shift press and delete or may be even mousemove.
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
|