
How to diable the screen saver from Vb5
Try the procedures below.
Regards - Jack Rasnick
Quote:
> Hi guys,
> I want to add a feature to my application,that is, I don't want the
> windows' screen saver to be executed when my application is running and
the
> user doesn't do anything for a specied amount of time for the screen
saver
> to launch.
> I think there must be some API calls through which I must check from my
> application wheather the screen saver is about to start and When it about
> start I should send a message to stop execute the screen saver. Thanks in
> advance
> vj,
Sub TurnOffScreenSaver()
Dim i As Integer
'Determine if the screen saver is on
i = SystemParametersInfo(SPI_GETSCREENSAVEACTIVE, 0&, fScreenSaveWasOn,
0&)
If fScreenSaveWasOn Then
'Tell Windows to disable screen savers
i = SystemParametersInfo(SPI_SETSCREENSAVEACTIVE, False, 0&, 0&)
End If
End Sub
Sub TurnOnScreenSaver()
Dim i As Integer
'First determine if the screen saver was on when this program was
IN_PROGRESS
If fScreenSaveWasOn Then
'Tell Windows to enable screen savers
i = SystemParametersInfo(SPI_SETSCREENSAVEACTIVE, True, 0&, 0&)
End If
End Sub