devxlogo

SetWallpaper – Change or remove the desktop wallpaper

SetWallpaper – Change or remove the desktop wallpaper

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 LongConst SPI_SETDESKWALLPAPER = 20Const SPIF_SENDWININICHANGE = &H2Const SPIF_UPDATEINIFILE = &H1' change the desktop wallpaper' returns True if successful'' omit the argument or pass a null string to' remove the current wallpaperFunction SetWallpaper(Optional ByVal FileName As String) As Boolean    If SystemParametersInfo(SPI_SETDESKWALLPAPER, 0, ByVal FileName, _        SPIF_SENDWININICHANGE Or SPIF_UPDATEINIFILE)Then        SetWallpaper = True    End IfEnd Function

devxblackblue

About Our Editorial Process

At DevX, we’re dedicated to tech entrepreneurship. Our team closely follows industry shifts, new products, AI breakthroughs, technology trends, and funding announcements. Articles undergo thorough editing to ensure accuracy and clarity, reflecting DevX’s style and supporting entrepreneurs in the tech sphere.

See our full editorial policy.

About Our Journalist