0

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?

aasoo
  • 31
  • 1
  • 4
  • For some reason each Window version handles this differently. There is no answer as far as I know. You don't really need this information anyway. – Barmak Shemirani Jan 27 '16 at 03:54
  • You can find this piece of information here: HKEY_CURRENT_USER\Control Panel\TranscodedImageCache (Windows 10). And yes, I definitely need the info! – aasoo Jan 27 '16 at 10:57
  • The documented interface is [IDesktopWallpaper](https://learn.microsoft.com/en-us/windows/win32/api/shobjidl_core/nn-shobjidl_core-idesktopwallpaper). Undocumented registry keys are subject to change. – Raymond Chen Mar 16 '20 at 21:41

2 Answers2

2

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

Artavazd Balayan
  • 2,353
  • 1
  • 16
  • 25
  • This path also just `%AppData%\Microsoft\Windows\Themes\TranscodedWallpaper`. – aasoo Jan 26 '16 at 20:43
  • I want to do stuff with the original file, so I need the path to the original file. So basically, I want to know the path to the file which got copied into the "Transcoded Wallpaper". – aasoo Jan 26 '16 at 20:52
  • May be this can be helpful. You can get current theme via [GetCurrentThemeName](https://msdn.microsoft.com/en-us/library/windows/desktop/bb773365%28v=vs.85%29.aspx) and parse that file. .theme file contains section Control Panel\Desktop with parameter Wallpaper – Artavazd Balayan Jan 26 '16 at 21:07
  • the parameter wallpaper contains the same. But the parameter TranscodedImageCache contains exactly what I am searching for! :) – aasoo Jan 26 '16 at 21:24
0

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

Community
  • 1
  • 1