Hey
During my web browser program i want to embed the very basic feature set as desktop background. i know how to set the image as desktop background but i am unsure how to get the image of the website
Any help is much appreciated
NSSLTD
Method to set image.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Microsoft.Win32;
using System.Runtime.InteropServices;
namespace DesktopWallpaper
{
public partial class Form1 : Form
{
[DllImport("user32.dll", CharSet = CharSet.Auto)]
static extern int SystemParametersInfo(int uAction, int uParam, string lpvParam, int fuWinIni);
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
ddlStyle.SelectedIndex = 0;
picThumbnail.SizeMode = PictureBoxSizeMode.Zoom;
picThumbnail.ImageLocation = GetCurrentWallpaper();
}
private void btnSet_Click(object sender, EventArgs e)
{
if (openGraphic.ShowDialog() == DialogResult.OK)
{
picThumbnail.ImageLocation = openGraphic.FileName;
picThumbnail.SizeMode = PictureBoxSizeMode.Zoom;
SetWallpaper(openGraphic.FileName, 2, 0);
}
}
private void SetWallpaper(string WallpaperLocation, int WallpaperStyle, int TileWallpaper)
{
SystemParametersInfo(20, 0, WallpaperLocation, 0x01 | 0x02);
RegistryKey rkWallPaper = Registry.CurrentUser.OpenSubKey("Control Panel\\Desktop", true);
rkWallPaper.SetValue("WallpaperStyle", WallpaperStyle);
rkWallPaper.SetValue("TileWallpaper", TileWallpaper);
rkWallPaper.Close();
}
private string GetCurrentWallpaper()
{
RegistryKey rkWallPaper = Registry.CurrentUser.OpenSubKey("Control Panel\\Desktop", false);
string WallpaperPath = rkWallPaper.GetValue("WallPaper").ToString();
rkWallPaper.Close();
return WallpaperPath;
}
}
}