What is Nostr?
Joel Bennett /
npub18dq…9qnp
2024-08-18 00:45:47
in reply to nevent1q…rmcy

Joel Bennett on Nostr: Set the Wallpaper using SystemParametersInfo ...

Set the Wallpaper using SystemParametersInfo

https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-systemparametersinfoa

In #PowerShell just:

Add-Type -Namespace "" -Name Desktop -MemberDefinition @"
[DllImport("user32.dll", CharSet = CharSet.Auto, EntryPoint="SystemParametersInfo")]
public static extern bool SetWallpaper(int uAction = 20, int uParam = 0, string Path="Wallpaper.jpg", int fuWinIni=3);
"@

Change the image with:

[Desktop]::SetWallpaper(20,0,(Convert-Path "MyPIcture.jpg"))

Without parameters, it reverts to Wallpaper.jpg
Author Public Key
npub18dqdtq38873745nxtqa2z54d6pfagzhespenkvqcwqsmyrlyp9rsqy9qnp