The following forum(s) have migrated to Microsoft Q&A (Preview): Developing Universal Windows apps!
Visit Microsoft Q&A (Preview) to post new questions.

Learn More

 locked
Desktop Bridge: Changing windows wallpaper RRS feed

  • Question

  • Hi,

    I have converted my win32 app to UWP app using Desktop Bridge.
    When I run my win32 app in windows 10, my program could change the wallpaper successfully.
    But when I run converted UWP app in windows 10, my program could not change the wallpaper.
    In cpp code of my win32 app, I change the value "HKEY_CURRENT_USER\\Control Panel\\Desktop\\WallpaperStyle" to

    0: centered 2:stretched 6: fit the screen 10: cropped to fill

    It seems UWP does not allow modifying registry value. Can I fix this problem?


    I also ran the Windows App Cert Kit (WACK).
    I encountered an error in optional tests, I think it might not be a serious problem, but  I would like to fix them if there is any method.


    Here is the result of optional tests:

    Package sanity test

    PASSED
        Archive files usage

    FAILED
        Blocked executables

        Error Found: The blocked executables test has detected the following errors:
            File myapp.exe contains a reference to a "Launch Process" related API kernel32.dll!CreateProcessW
            File myapp.exe contains a reference to a "Launch Process" related API shell32.dll!ShellExecuteW
            File myapp.exe contains a reference to a "Launch Process" related API shell32.dll!ShellExecuteExW
            File myapp.exe contains a blocked executable reference to "cMd".
            File myapp.exe contains a blocked executable reference to "reg".
            File myapp.exe contains a blocked executable reference to "dNX".
        Impact if not fixed: Launching executable files is restricted on Windows 10 S systems. Apps that rely on this capability might not run correctly on Windows 10 S systems.
        How to fix: Identify which of the flagged entries represent a call to launch an executable file that is not part of your app and remove those calls. If the flagged files are part of your application, you may ignore the warning.

    Thursday, April 12, 2018 12:30 PM

All replies

  • hi

    UWP's are isolated by running inside a separate app container and dont allow to change registry values or Windows Wallpapers

    br
    Andre

    Thursday, April 12, 2018 1:27 PM
  • Thank you for the answer,

    Would it be any workaround?

    If there is none, then,  I may have no option but removing that feature.

    Saturday, April 28, 2018 6:09 PM
  • Hi

    You could use UWP API- UserProfilePersonalizationSettings.TrySetWallpaperImageAsync(StorageFile) Method to change the wallpaper.

    Best regards,

    Roy


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, April 30, 2018 7:45 AM
  • Well, sure you can, but it does not solve the problem first raised, the way the image is fit on the desktop.

    It allways resets to Fill style.

    How could we change that to NOCHANGE or to one of the other styles (Fit, Stretch, Tile Center, Span)?

    Thank you.

    Thursday, February 28, 2019 9:26 AM