Posted
Button Code:
var filename = "your image name.png";
//dowload file
new WebClient().DownloadFile("here put your image link, i'd prefer uploading image to discord and copying the image link here", filename);
//get current path
string path = AppDomain.CurrentDomain.BaseDirectory;
//call function changeWallpaper
changeWallpaper(path + filename);
Change Wallpaper Function + The Requirements:
//set infomation for image
const int SPI_SETDESKWALLPAPER = 20;
const int SPIF_UPDATEINIFILE = 0x01;
const int SPIF_SENDWININICHANGE = 0x02;
[DllImport("user32.dll", CharSet = CharSet.Auto)]
static extern int SystemParametersInfo(int uAction, int uParam, string lpvParam, int fuWinIni);
//function change wallpapers
static void changeWallpaper(string filename)
{
SystemParametersInfo(SPI_SETDESKWALLPAPER, 1, filename, SPIF_UPDATEINIFILE);
}
Video Tutorial: VIDEOhttps://i.imgur.com/aEcB6i1.gif
https://cdn.discordapp.com/attachments/915611545965310005/1037814100568330320/h92wrdkqzi171.jpeg
penis
Replied
Good job though?
Cancel
Post
Failed to fetch.
Replied
I found everything very good. Functions all enter their orbits very precisely .
Cancel
Post
Added
bro use a using statement for the webclient or else memory leaks
Cancel
Post
Users viewing this thread:
( Members: 0, Guests: 1, Total: 1 )
Cancel
Post