Private 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 Const SPI_SETDESKWALLPAPER = 20 Const SPIF_SENDWININICHANGE = &H2 Const SPIF_UPDATEINIFILE = &H1
Function SetWallpaper(Optional ByVal FileName As String) As Boolean If SystemParametersInfo(SPI_SETDESKWALLPAPER, 0, ByVal FileName, _ SPIF_SENDWININICHANGE Or SPIF_UPDATEINIFILE)Then SetWallpaper = True End If End Function |