简体   繁体   English

获取当前桌面壁纸的路径

[英]get path to current desktop wallpaper

As mentioned in the title, I want to get the path to the current desktop wallpaper (in C++).正如标题中提到的,我想获取当前桌面壁纸的路径(在 C++ 中)。 I tried to use SystemParametersInfo with SPI_GETDESKWALLPAPER .我尝试将SystemParametersInfoSPI_GETDESKWALLPAPER一起使用。 But this only returns this:但这只会返回:

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

What I really need would be something like this:我真正需要的是这样的:

C:\\User\\...\\image.png C:\\用户\\...\\image.png

Is there any way to achieve this?有没有办法实现这一目标?

There is registry hive HKEY_CURRENT_USER\\Control Panel\\Desktop .有注册表配置单元HKEY_CURRENT_USER\\Control Panel\\Desktop It has value with name Wallpaper .它具有名称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.您可以转到注册表的 HKEY_CURRENT_USER\\Control Panel\\Desktop 部分,找到转码为 TranscodedWallpaper 的六个最近文件。 There names有名字

  • TranscodedImageCache转码图像缓存
  • TranscodedImageCache_000 TranscodedImageCache_000
  • TranscodedImageCache_001转码图像缓存_001
  • TranscodedImageCache_002转码图像缓存_002
  • TranscodedImageCache_003转码图像缓存_003
  • TranscodedImageCache_004转码图像缓存_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基本上,它可以在没有任何工具的情况下阅读:这里看起来像但是可以使用任何能够显示 unicode 文本的工具将其转换为更具可读性的视图

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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