How can I programmatically change/set the lock screen background image (using VB.NET, C# or Visual C++)? I am using Win 10 Pro and have Visual Studio 2017 Pro.
I've had a look online but most solutions don't seem to work. For example:
System.Windows.Media.Imaging
, Windows.Storage
, Windows.Storage.Streams
, Windows.System.UserProfile
cannot be found when I paste the code. Do I need to add specific references?Most sources (also Windows Dev Center - LockScreen Class) seem to suggest Windows.System.UserProfile.LockScreen.SetImageFileAsync(file);
but I am apparently missing the specific namespace/import/package to make it run.
Any help would be appreciated.
Customize your lock screen imageSelect Start > Settings . Select Personalization > Lock screen . Select the list for Background, then do one of the following: Select Windows spotlight for beautiful photography that displays automatically.
Now, we need to find the folder containing the lock screen photos. For this, navigate to This PC > (C:) > Users > UserName > AppData > Local > Packages > Microsoft. Windows.
I've found an easier way using this question Windows 10 Pro lockscreen mass change. All I need to do is set the registry entries under
Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\PersonalizationCSP
DesktopImagePath
DesktopImageUrl
LockScreenImagePath
LockScreenImageUrl
to the path of the desired picture, which works without UWP or WPF.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With