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:
HKCUSoftwareMicrosoftWindowsCurrentVersionExplorerWallpapersBackgroundType = 3