Home
Search
 
What's New
Index
Books
Links
Q & A
Newsletter
Banners
 
Feedback
Tip Jar
 
C# Helper...
 
XML RSS Feed
Follow VBHelper on Twitter
 
 
MSDN Visual Basic Community
 
 
 
 
 
TitleChange the desktop wallpaper
Keywordswallpaper, desktop, SystemParametersInfo
CategoriesWindows, Utilities
 
Use the SystemParametersInfo API function. If the final parameter is SPIF_UPDATEINIFILE, the change is made permanently in the system INI file. If this parameter is 0, the wallpaper is temporary and not redisplayed the next time you boot.

My book Custom Controls Library includes several controls that manipulate this and other system properties like cursor blink rate, double click speed, and so forth.

 
Private Sub cmdSetWallpaper_Click()
Dim upd As Integer

    If chkUpdateRegistry.Value = vbChecked Then
        upd = SPIF_UPDATEINIFILE
    Else
        upd = 0
    End If

    SystemParametersInfo SPI_SETDESKWALLPAPER, _
        0, txtFileName, upd
End Sub
 
 
Copyright © 1997-2010 Rocky Mountain Computer Consulting, Inc.   All rights reserved.
  Updated