Quick summary of question: In Windows 7, using Powershell or a little C#, how can we tell if a custom theme is going to leave a single image or do a slideshow in the background?
(Related questions but not quite the same and not answered:
- How to resume Windows 7 slideshow after restoring default wallpaper (not answered / separate issue)
- https://stackoverflow.com/questions/10556820/programatically-enable-windows-7-desktop-slideshow (not answered / separate issue)
- How can I detect wallpaper changing as a result of the Windows 7 slideshow? (answers don't work for win 7 / separate issue)
Related resource, but didn't help:
)
The question is pretty much what it sounds like, and I am not sure why it is having so much trouble.
In Win8 I can use technique's based on Andy's post ( Powershell script from shortcut to change desktop ) to get the source image. From there and from what I can tell, slideshow always ends up in TranscodedWallpaper.jpg, and as soon as you drop to a single image it switches to the name of the image. So a bit round-about, but I can tell if slideshow is on
In Win7 I can check WallpaperSource
Get-ItemProperty 'HKCU:\Software\Microsoft\Internet Explorer\Desktop\General' WallpaperSource
but it only gives me the current image if there is a slideshow, and if we are using a 'Custom.theme' then
Get-ItemProperty -path 'HKCU:Control Panel\Desktop' -name 'Wallpaper'
returns TranscodedWallpaper.jpg each time, even if there is only one image left in there and no time interval. (Regardless if I use the above command or Andy's script)
I've tried running Process Monitor to figure out what windows does, and it plays a little in 'C:\Windows\Globalization\MCT\MCT-US\Wallpaper\desktop.ini' but it doesn't seem to leave any marks I can use. It helped me find
Get-ItemProperty -path 'HKCU:Control Panel\Personalization\Desktop Slideshow'
which has a Shuffle and Interval field, but neither changes when we are in a Custom theme - single image vs a Custom theme - slideshow.
I am sure I am missing very obvious (being new to playing on this end of Windows and Powershell).. any thoughts?
Took a while but I figured it out (or figured out a solution). If anyone else runs across this, Win 7 has an ini file:
When there is only one picture in the 'slideshow' this file becomes empty, so using .WallpaperSource is the correct background image. When there are multiple images in a slideshow then this file has content (the information on transitioning the background) so even if .WallpaperSource seems like the right image, it will likely change over time based on the interval.
In short, from what I can see (and until I run across the situation that breaks this rule and I go back to the drawing board), to see if you have a slideshow you:
(This is of course only for the build in Windows 7 functionality, no idea how it would react to all the custom code and apps out there). And the Win 8 solution is up in the initial question