I'm working on a tool that needs to get the current user's wallpaper path.
On Windows 7, I can get that by reading
HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Desktop\General\WallpaperSource
.
On my Windows 8 installation, that key always has the value
C:\Users\Peter\AppData\Roaming\Microsoft\Windows Photo Viewer\Windows Photo Viewer Wallpaper.jpg
which is not even the wallpaper that's currently set.
Is there any other key I can rely on?
You are FAR better off calling SystemParametersInfo with the SPI_SETDESKWALLPAPER option to set the desktop wallpaper. As far as I can tell, registry key you're using is undocumented and thus can change at any time without warning.
See this stack overflow question for an example of how to call the SystemParametersInfo with SPI_SETDESKWALLPAPER.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With