简体   繁体   中英

get path to current desktop wallpaper

As mentioned in the title, I want to get the path to the current desktop wallpaper (in C++). I tried to use SystemParametersInfo with SPI_GETDESKWALLPAPER . But this only returns this:

%AppData%\\Microsoft\\Windows\\Themes\\TranscodedWallpaper

What I really need would be something like this:

C:\\User\\...\\image.png

Is there any way to achieve this?

There is registry hive HKEY_CURRENT_USER\\Control Panel\\Desktop . It has value with name Wallpaper . It contains the path to the current wallpaper.

You can go to HKEY_CURRENT_USER\\Control Panel\\Desktop section of your registry and find six recent files transcoded to TranscodedWallpaper. There names

  • TranscodedImageCache
  • TranscodedImageCache_000
  • TranscodedImageCache_001
  • TranscodedImageCache_002
  • TranscodedImageCache_003
  • TranscodedImageCache_004

Basically, it can be read without any tools: Here it looks like But it can be converted to more readable view with any tool capable to show unicode text

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM