Meanie Posted February 21, 2003 Posted February 21, 2003 Problems setting wallpaper Hi, I've been writing a program to change the wallpaper, but it just won't work Here's the code I've been using to set new wallpaper Private Declare Function SystemParametersInfo Lib "user32" Alias "SystemParametersInfoA" (ByVal uAction As Long, ByVal uParam As Long, ByVal lpvParam As String, ByVal fuWinIni As Long) As Long Const SPI_SETDESKWALLPAPER = 20 Const SPIF_UPDATEINIFILE = &H1 Const SPIF_SENDWININICHANGE = &H2 Private Sub SetWallpaper() Dim lReturnVal as Long lReturnVal = SystemParametersInfo(SPI_SETDESKWALLPAPER, 0, "C:\Temp\Test.bmp", SPIF_UPDATEINIFILE Or SPIF_SENDWININICHANGE) End Sub When SetWallpaper() is called (at a press of a button, atm), the whole desktop flickers but the wallpaper doesn't change, and no amount of refreshing will help. Also, lReturnVal returns a non-zero character, and that means success (right?) so its obviously working, except it isn't. Is there is anything I'm missing? Quote
*Gurus* divil Posted February 21, 2003 *Gurus* Posted February 21, 2003 Try changing all Long parameters in your declare to Integers, see if that helps. Quote MVP, Visual Developer - .NET Now you see why evil will always triumph - because good is dumb. My free .NET Windows Forms Controls and Articles
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.