How to change lockscreen wallpaper by using Windows SDK (C++) or modifying registry?

Jiakang Li 20 Reputation points
2023-05-09T04:03:47.9333333+00:00

Hi all.

My Windows version is Windows 10 22H2 19045.2846, and I'd like to change my lockscreen wallpaper by using Windows SDK (or dll function), but I can't find any function for it.

I want to get a function, which is equal to [Setting]-[Personalize]-[Lockscreen Interface]-[Select picture] operation.

How can I implement this functionality (not using UWP/C# but C++ or C)?

Windows development | Windows API - Win32
Windows for business | Windows Client for IT Pros | User experience | Other
Developer technologies | C++
0 comments No comments
{count} votes

Accepted answer
  1. Jeanine Zhang-MSFT 11,356 Reputation points Microsoft External Staff
    2023-05-09T07:05:48.65+00:00

    Hello,

    Welcome to Microsoft Q&A!

    According to your description (Windows SDK) and the tag (Windows App SDK), whether you want to use winui3 project (Windows App SDK) or desktop project (Windows SDK)?

    For desktop project:

    According to the Doc: Personalization CSP

    I suggest you could try to change the registry by creating a new key in the

    Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\PersonalizationCSP

    For more details, you could refer to the threads:

    https://social.technet.microsoft.com/Forums/windows/zh-CN/8e02368a-3ce9-4e08-b596-7e10483a6679/3245231574300532716926495?forum=WinServerPreviewZHCN

    https://stackoverflow.com/a/51785913

    For winui3 project:

    You could follow Castorix31's suggestion. And you could refer to the sample: Lock screen personalization sample

    Thank you.

    Jeanine


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    1 person found this answer helpful.

2 additional answers

Sort by: Most helpful
  1. Castorix31 90,686 Reputation points
    2023-05-09T06:01:23.0933333+00:00
    1 person found this answer helpful.

  2. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.