Di bawah ini merupakan fungsi VB6 untuk merubah desktop wallpaper. Bagaimana implementasinya dalam Visual Basic 6.0?
READ MORE - VB6 Code - Fungsi Untuk Merubah Desktop Wallpaper
Option ExplicitContoh penggunaan kode di atas
Private Declare Function SystemParametersInfo Lib "user32" Alias "SystemParametersInfoA" (ByVal uAction As Long, ByVal uParam As Long, ByVal lpvParam As Any, ByVal fuWinIni As Long) As Long
Private Const SPIF_SENDWININICHANGE = &H2
Private Const SPIF_UPDATEINIFILE = &H1
Private Const SPIF_SETDESKWALLPAPER = 20
Public Function ChangeWallPaper(imgFile As String)
Call SystemParametersInfo(SPIF_SETDESKWALLPAPER, 0&, imgFile, SPIF_UPDATEINIFILE Or SPIF_SENDWININICHANGE)
End Function
Private Sub Command1_Click()
Call ChangeWallPaper("C:\Windows\Blue.bmp")
End Sub