=====Setting the Desktop wallpaper===== //by Jon Ripley, July 2007//\\ \\ ==== Setting the Desktop wallpaper ==== \\ To set the current Desktop wallpaper use the following code: SPIF_UPDATEINIFILE = 1 SPI_SETDESKWALLPAPER = 20 SYS "SystemParametersInfo", SPI_SETDESKWALLPAPER, 0, filename$, SPIF_UPDATEINIFILE Here the **filename$** parameter is the full path to a bitmap image (.BMP) to set as the Desktop wallpaper. To use images in unsupported file formats - such as .GIF and .PNG - as Desktop wallpaper they must first be converted to Window bitmap (.BMP) format. Under Windows Vista **filename$** can point to a JPEG image (.JPG or .JPEG). ==== Removing the Desktop wallpaper ==== To remove the current Desktop wallpaper use code similar to the following: SPIF_UPDATEINIFILE = 1 SPI_SETDESKWALLPAPER = 20 SYS "SystemParametersInfo", SPI_SETDESKWALLPAPER, 0, "", SPIF_UPDATEINIFILE Here the only difference is that the file name parameter is empty. ==== Retrieving the current Desktop wallpaper ==== To retrieve the full path to the current Desktop wallpaper use code similar to the following: MAX_PATH = 260 DIM wp% MAX_PATH - 1 SPI_GETDESKWALLPAPER = 115 SYS "SystemParametersInfo", SPI_GETDESKWALLPAPER, MAX_PATH, wp%, 0 BackDrop$ = $$wp% Here **BackDrop$** will contain the full path to the current Desktop wallpaper or NUL if no wallpaper is in use. As always, make sure you execute the **DIM** statement only once, or use **DIM LOCAL**, to avoid a memory leak and an eventual **No room** error.