Get the current Desktop Wallpaper
All tutorials created in C# to be posted in here.
3 posts
Page 1 of 1
In this tutorial you will learn how to get the current Desktop Wallpaper using Registry.
Start by creating a Windows Forms Application and import this Namespace:
Start by creating a Windows Forms Application and import this Namespace:
Code: Select all
Now inside your class put this code:
using Microsoft.Win32;
Code: Select all
Calling that method is as simple as this for example:
private Image GetCurrentWallpaper()
{
//Get Registry Key
RegistryKey _RegEntry = Registry.CurrentUser.OpenSubKey("Control Panel" + @"\" + "Desktop", false);
//Check && Return
if (_RegEntry.GetValue("Wallpaper") != null)
{
return Image.FromFile(_RegEntry.GetValue("Wallpaper").ToString());
}
else
{
MessageBox.Show("Registry Value 'Wallpaper' does not exist!");
return null;
}
}
Code: Select all
That's it! I know its not much but i believed it was worth sharing. this.BackgroundImage = GetCurrentWallpaper();
You can find me on Facebook or on Skype mihai_92b
nice share
visit us on:
http://www.softpedia.com/get/System/Lau ... -Run.shtml
Check it out ! http://www.softpedia.com/publisher/I-A- ... 90017.html
Check it out ! http://www.softpedia.com/get/Desktop-En ... lock.shtml
http://www.softpedia.com/get/System/Lau ... -Run.shtml
Check it out ! http://www.softpedia.com/publisher/I-A- ... 90017.html
Check it out ! http://www.softpedia.com/get/Desktop-En ... lock.shtml
3 posts
Page 1 of 1
Copyright Information
Copyright © Codenstuff.com 2020 - 2023