Created: March 1, 1995
Within your own application, you can change various Windows® settings that are usually modified by using the Control Panel. One of these settings allows you to change the Desktop wallpaper. The SystemParametersInfo function can be used to select a new wallpaper for the Desktop from within your application.
The SystemParametersInfo function can also be used to remove the Desktop wallpaper so that no wallpaper will be used at all.
The following code shows how to remove the Desktop wallpaper and set the default to None.
Const SPIF_UPDATEINIFILE = &H1
Const SPI_SETDESKWALLPAPER = 20
Const SPIF_SENDWININICHANGE = &H2
Declare Function SystemParametersInfo Lib "User" (ByVal uAction As Integer, ByVal uparam As Integer, ByVal lpvParam As String, ByVal fuWinIni As Integer) As Integer
Sub Command1_Click()
filenm$ = "(none)"
x% = SystemParametersInfo(SPI_SETDESKWALLPAPER, 0&, filenm$, SPIF_UPDATEINIFILE Or SPIF_SENDWININICHANGE)
End Sub
After executing this program, the current wallpaper should be removed from the Desktop.
Knowledge Base Q97142. "How to Use SystemParametersInfo API for Control Panel Settings." (MSDN Library, Knowledge Base)