Monday, May 28, 2012

Fungsi VB6 - Untuk Memperoleh Time Out Screen Saver

Mengenai fungsi VB6 untuk memperoleh timeout screen saver - Bagaimanakah kita dapat memperoleh time out dari screen saver melalui kode VB6, berikut adalah jawabanya:
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