On my PC I had to disable my windows screen saver it kept shutting down VB6. Now the same thing is happening on a client site to a program I wrote. When power saver executes the program shuts down. Is there anything I can do besides disabling power saver?
With this source code you can activate/deactivate the screen saver. It's useful if you don't want that the screen saver will start running when your application is running. When the user close your application you can activate the screen saver again.
Form Code
Private Const SPI_SETSCREENSAVEACTIVE = 17
Private Const SPIF_UPDATEINIFILE = &H1
Private Const SPIF_SENDWININICHANGE = &H2
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
Public Function ActivateScreenSaver(Active As Boolean) As Boolean
Private Sub Form_Load()
'the line code below will deactivate the screen saver. if you want
'to activate the screen saver, change the 'False' below to 'True'
ActivateScreenSaver (False)
End Sub
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.