Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatic change lock screen #31

Closed
zhaojinpeng111 opened this issue Jun 27, 2018 · 5 comments
Closed

Automatic change lock screen #31

zhaojinpeng111 opened this issue Jun 27, 2018 · 5 comments
Labels
enhancement New feature or request wontfix This will not be worked on

Comments

@zhaojinpeng111
Copy link

Change lock screen picture same as desktop

@zhaojinpeng111 zhaojinpeng111 changed the title Automatic change lock screen? Automatic change lock screen Jun 27, 2018
@t1m0thyj t1m0thyj added the enhancement New feature or request label Jul 5, 2018
@t1m0thyj
Copy link
Owner

t1m0thyj commented Jul 5, 2018

I like this idea, from a standpoint of trying to imitate Mojave's Dynamic Desktop feature this makes sense because the lockscreen image on macOS is the same as the desktop wallpaper as far as I can tell.

However, it doesn't seem like there's a good API to change the Windows lockscreen image in C#. Also in order for it to look good the image would have to update before the lockscreen image loads on the screen, and I'm not sure I would be able to do that.

The real solution to this problem would be to somehow make Windows use the desktop wallpaper as the lockscreen image. I wish this feature was built-in to Windows, and unfortunately I'm not aware of any program that does this, probably because of the reasons I mentioned above.

@t1m0thyj t1m0thyj added the wontfix This will not be worked on label Jul 8, 2018
@t1m0thyj t1m0thyj closed this as completed Jul 8, 2018
@okms
Copy link

okms commented Jan 9, 2020

Hi,

First of all: thank you for putting so much time and effort into developing this great app. Really. It's awesome.

I know this issue is closed but just wanted to ask you @t1m0thyj if setting the lockscreen in the UWP app could be possible using something like this: https://docs.microsoft.com/en-us/uwp/api/windows.system.userprofile.userprofilepersonalizationsettings

@t1m0thyj
Copy link
Owner

t1m0thyj commented Jan 12, 2020

@okms I've tried using the UWP API in WDD with the experimental changeLockscreen setting. Unfortunately it doesn't work, the image changes only once and stays the same afterwards, even when the API is called repeatedly with different images. This is an issue that was reported 4 years ago, but has yet to be acknowledged or fixed by Microsoft.

@Darthagnon
Copy link

Winaero Lock Screen Customizer for Windows 8 and 8.1 can change the lockscreen image, as can Windows 7 Lockscreen Changer and the classic Julien Manici's Windows 7 Logon Background Changer - might be some implementation ideas in those programs?

@myfix16
Copy link

myfix16 commented Jul 12, 2021

I wrote a WPF application with the LockScreen class:

using System;
using Windows.Storage;
using Windows.System.UserProfile;

    public class ImageChanger
    {
        public static async Task ChangeLockScreenImage(string path)
        {
            var file = await StorageFile.GetFileFromPathAsync(path);
            await LockScreen.SetImageFileAsync(file);
        }
    }

And call it in App.xaml.cs:

public partial class App : Application
    {
        public App()
        {
            var path = Environment.GetCommandLineArgs()[1];
            Task.Run(async () =>
            {
                await ImageChanger.ChangeLockScreenImage(path);
                Environment.Exit(0);
            });
        }
    }

Then I run the app with a powershell script using WDD's powershell script functionality:

param (
    [Parameter(Mandatory=$true)][int]$daySegment2,  # 0 = Day, 1 = Night
    [Parameter(Mandatory=$true)][int]$daySegment4,  # 0 = Sunrise, 1 = Day, 2 = Sunset, 3 = Night
    [Parameter(Mandatory=$true)][string]$imagePath  # Path to current wallpaper image
)

<Some Path>\LockScreenSync.exe $imagePath

And it works fine for me. Maybe calling this API with a temporary process can make it work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

5 participants