Changing the Desktop Wallpaper Programmatically on Windows

Published 12 October 07 01:39 PM | john 

My friend Scott asked me the other day how he might go about changing the desktop wallpaper programmatically.  It's one of those things that is still buried in the native Windows Win32 API.  The call you need is SystemParametersInfo and the action you need is SPI_SETDESKWALLPAPER.

Scott pointed out that this only takes a bitmap.  On Windows XP, if you set the desktop wallpaper to a JPEG under Control Panel it actually converts it to a bitmap and then makes this call.  With Windows Vista, the JPEG can be set directly. 

Filed under: , , ,

Comments

No Comments
Anonymous comments are disabled