Reputation: 87
Context
I have a console application in .Net 6 C# that changes the current user's desktop wallpaper to an image for a given time. I backup the current wallpaper configuration of the user by reading the registry. At the end of the givent time, I would like to restore the wallpaper configuration the user had at the beginning.
I managed to restore the image mode, color and slideshow mode but I didn't managed to restore Windows Spotlight mode yet. Ideally I'd like it to work on Windows 10, 11, Windows Server 2016, 2019 and 2022 (I realize there might be differences between thos environments).
Question
How can I restore a desktop wallpaper configuration to Windows Spotlight mode in C#?
Tried Solution
I tried setting the following registry key but it did nothing:
HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Wallpapers\BackgroundType = 3
Update 01/08/2024
I managed to change the Wallpaper mode to 'Windows spotlight' in the Wallpaper Personalization Settings UI but it did not effectively changed the wallpaper. Althoug the settings is shown as set, it's like the 'Spotlight manager' (or whatever handle the windows spotlight mode) is not running. To achieve that state I applied those registry keys:
HKCU\SOFTWARE\Policies\Microsoft\Windows\CloudContent\DisableWindowsSpotlightFeatures = 0
HKCU\SOFTWARE\Policies\Microsoft\Windows\CloudContent\DisableSpotlightCollectionOnDesktop = 0
HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Wallpapers\BackgroundType = 3
HKCU\Software\Microsoft\Windows\CurrentVersion\DesktopSpotlight\Settings\EnabledState = 1
I tried restarting explorer.exe as suggested in other posts as well a login/logout and restart the desktop but it did not change anything. I remain in this unconsistent state
Upvotes: 0
Views: 427