I want to set Lock Screen Wallpaper of Windows 10 and above from WPF application. I have searched and found the following links are useful.
https://stackoverflow.com/a/51785913/5523095
https://superuser.com/a/1274588
Based on the suggestion from the above answers I am trying to change the lock screen wallpaper using the following code.
RegistryKey key = Registry.CurrentUser.CreateSubKey(@"Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\PersonalizationCSP", true);
key.SetValue(@"LockScreenImagePath", @"C:\Users\kumarm\Desktop\Wall.png");
key.SetValue(@"LockScreenImageUrl", @"C:\Users\kumarm\Desktop\Wall.png");
key.SetValue("LockScreenImageStatus", 1, RegistryValueKind.DWord);
key.Flush();
But the lock screen wallpaper is not changing. Am I doing anything wrong?