Option Explicit
Private Declare Function SystemParametersInfo Lib "user32" Alias "SystemParametersInfoA" (ByVal uAction As Long, ByVal uParam As Long, lpvParam As Any, ByVal fuWinIni As Long) As Long
Private Const SPI_GETSCREENSAVETIMEOUT = 14
Function ScrTimeOut() As Integer
Dim intValue As Integer
Call SystemParametersInfo(SPI_GETSCREENSAVETIMEOUT, vbNull, intValue, 0)
ScrTimeOut = intValue
End Function
Cara menggunakan fungsi VB6 diatas:
Private Sub Command1_Click()
MsgBox ("Screen saver time-out value: " & ScrTimeOut & " seconds.")
End Sub