How to restore windows desktop wallpaper to Slideshow and Windows Spotlight mode in C#?

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 and color mode but I didn’t managed to restore Slideshow nor Windows Spotlight mode. 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).

The keys I use to read the curent configuration

HKCUControl PanelDesktopWallpaper      # to read the wallpaper image filepath
HKCUControl PanelDesktopWAllpaperStyle # to read the wallpaper image style (fill, fit ...)
HKCUControl PanelColorsBackground      # to read the background color
HKCUSoftwareMicrosoftWindowsCurrentVersionExplorerWallpapersBackgroundType # to read the background mode (image, color, slideshow, windows spotlight)

Solutions for restoring Image and colors

To restore the image I used the IDesktopWallpaper interface and to restore colors, I used registry keys:

HKCUControl PanelColorsBackground # to restore the saved color
HKCUControl PanelDesktopWallpaper = "" # to not show any image
HKCUControl PanelDesktopWallpaperStyle = 0
HKCUControl PanelDesktopTileWallpaper = 0

I then called the following function to refresh the desktop by reading the registry.

SystemParametersInfo(SPI_SETDESKWALLPAPER, 0, null, SPIF_UPDATEINIFILE | SPIF_SENDCHANGE);

Solutions tried for restoring Slideshow

I tried 2 solutions: using the IDesktopWallpaper interface with SetSlideshow() and setting some registry keys.

For the IDesktopWallpaper.SetSlideshow, I don’t know how I can transform from a List to a IShellItemArray. (see https://learn.microsoft.com/fr-fr/windows/win32/api/shobjidl_core/nf-shobjidl_core-idesktopwallpaper-setslideshow)

For the registry solution, I tried setting the following registry keys but the wallpaper simply switch from image mode to color mode.

HKCUSoftwareMicrosoftWindowsCurrentVersionExplorerWallpapersSlideshowEnabled = 1 # Activate slideshow mode
HKCUSoftwareMicrosoftWindowsCurrentVersionExplorerWallpapersSlideshowDirectoryPath = "My/Specific/Folder/Path" # Specifies the folder to scan for images
HKCUSoftwareMicrosoftWindowsCurrentVersionExplorerWallpapersSlideshowTickCount = 60000 # Specifies the delay between two images
HKCUSoftwareMicrosoftWindowsCurrentVersionExplorerWallpapersBackgroundType = 2 # Specifies the slideshow mode

HKCUControl PanelPersonalizationDesktop SlideshowInterval = 60000 # For any reasons there is an other key to specify the delay between two images
HKCUControl PanelPersonalizationDesktop SlideshowShuffle = 0 # Whether or not images should be displayed in random order

HKCUControl PanelDesktopWallpaper = "" # to not show any image
HKCUControl PanelDesktopWallpaperStyle = 6 # apparently this could have a role in specifying slideshow mode
HKCUControl PanelDesktopTileWallpaper = 0

Are there any other API that exists that I didn’t mention? Am I missing something in the slideshow configuration?

Bonus Question: Is it possible to restore the Windows spotlight mode for wallpaper?

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật