Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Disabling the screen saver

Status
Not open for further replies.

bigfoot

Programmer
May 4, 1999
1,779
US
Is there anyway to disable the screen saver while a program is running? I have a program on my NT box that gets called from the AS/400. If it has a problem, the AS/400 operator does'nt know about it, so I thought I'd do a NET SEND to the screen, but the screen saver on the NT server blocks it.
I thought I'd disable the screen saver, run the program, enable it again.

Thanks
-Gary
 
Public Const SPI_GETSSACTIVE = 16
Public Const SPI_SETSSACTIVE = 17

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


Dim bSuccess As Integer
Dim uiParam As Integer

bSuccess = SystemParametersInfo(SPI_GETSSACTIVE, 0, uiParam, 0)
If bSuccess <> 0 Then
If uiParam <> 0 Then
MsgBox &quot;Screen Saver being Disabled&quot;
bSuccess = SystemParametersInfo(SPI_SETSSACTIVE, 0, 0, 0)
MsgBox &quot;Screen Saver being Re-enabled&quot;
bSuccess = SystemParametersInfo(SPI_SETSSACTIVE, 1, 0, 0)
End If
Else
MsgBox &quot;problem&quot;
End If
Jon Hawkins
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top