Setting the desktop background

From ISXKB

Revision as of 10:31, 18 December 2006 by Dean Earley (Talk | contribs)
(diff) ←Older revision | Current revision (diff) | Newer revision→ (diff)
Jump to: navigation, search
This article is currently work in progress. You can help to improve the ISXKB by extending this article.


Taken from news://news.jrsoftware.org:119/em4i5i$685$1@news.jrsoftware.org

Quoth Jordan Russell:
> For the change to take effect immediately, you have to call
> SystemParametersInfo(SPI_SETDESKWALLPAPER, ...). I'm not sure if that API
> accepts JPG files, though. You might have to convert your image to BMP
> first.

What you'd need to do to "hack" it in would be to set ConvertedWallpaper to
the name of your JPG file, then convert it to a BMP and set Wallpaper to that,
and then set your tiling/centering mode appropriately.  And of course as Jordan
said, none of this will work until after reboot unless you use the API call.

There's a reasonably good chance that the API call does support JPGs (but
probably only in recent versions of Windows), and it's the only official way to
set the wallpaper.  Setting registry entries directly is not supported by
Microsoft so they're free to break it in future versions of Windows if they feel
like it.
Personal tools
Ads: