Last active
October 21, 2024 01:41
-
-
Save kinguser981/e225874e2ca981c0703235cc694f0d81 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Invoke-WebRequest https://github.com/kinguser981/Personal_files/releases/download/11312652930/my_edit.jpg -OutFile c:\my_edit.jpg | |
$setwallpapersrc = @" | |
using System.Runtime.InteropServices; | |
public class Wallpaper | |
{ | |
public const int SetDesktopWallpaper = 20; | |
public const int UpdateIniFile = 0x01; | |
public const int SendWinIniChange = 0x02; | |
[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Auto)] | |
private static extern int SystemParametersInfo(int uAction, int uParam, string lpvParam, int fuWinIni); | |
public static void SetWallpaper(string path) | |
{ | |
SystemParametersInfo(SetDesktopWallpaper, 0, path, UpdateIniFile | SendWinIniChange); | |
} | |
} | |
"@ | |
Add-Type -TypeDefinition $setwallpapersrc | |
[Wallpaper]::SetWallpaper("C:\my_edit.jpg") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment