You don't have to guild me, but here's a working solution in C#.
As a bonus, it removes the watermark.
Screenshot: http://imgur.com/gyKNWbI.png
You can download it here: http://www.filedropper.com/ciraupdater
NOTE: I don't usually use filedropper.com - I would feel a lot safer uploading it to a personal webserver, but meh.
I ran it through VirusTotal and I'm getting what looks like one false positive - a trojan that uses the wallpaper changing class that I snagged from here: http://stackoverflow.com/questions/1061678/change-desktop-wallpaper-using-code-in-net
Program.cs:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Timers;
namespace CIRAUpdater
{
class Program
{
private static Timer ticky = new Timer();
static void Main(string[] args)
{
Console.WriteLine("CIRA Updater by DarkTussin" + Environment.NewLine);
ticky.Elapsed += ticky_Elapsed;
ticky.Interval = 100000;
ticky.Enabled = true;
ticky_Elapsed(null, null);
System.Windows.Forms.Application.Run();
}
static void ticky_Elapsed(object sender, ElapsedEventArgs e)
{
Console.Write("Updating...");
Wallpaper.Set(new Uri("http://rammb.cira.colostate.edu/ramsdis/online/images/latest_hi_res/himawari-8/full_disk_ahi_true_color.jpg"),Wallpaper.Style.Centered);
Console.WriteLine("Updated!");
}
}
}
Wallpaper.cs:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Runtime.InteropServices;
using System.Windows.Forms;
using System.IO;
using System.Drawing;
namespace CIRAUpdater
{
public sealed class Wallpaper
{
Wallpaper() { }
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);
public enum Style : int
{
Tiled,
Centered,
Stretched
}
public static void Set(Uri uri, Style style)
{
System.IO.Stream s = new System.Net.WebClient().OpenRead(uri.ToString());
System.Drawing.Image img = System.Drawing.Image.FromStream(s);
System.Drawing.Graphics.FromImage(img).FillRectangle(new SolidBrush(Color.Black), new Rectangle(9, 5088, 944, 405));
string tempPath = Path.Combine(Path.GetTempPath(), "wallpaper.bmp");
img.Save(tempPath, System.Drawing.Imaging.ImageFormat.Bmp);
Microsoft.Win32.RegistryKey key = Microsoft.Win32.Registry.CurrentUser.OpenSubKey(@"Control Panel\Desktop", true);
if (style == Style.Stretched)
{
key.SetValue(@"WallpaperStyle", 2.ToString());
key.SetValue(@"TileWallpaper", 0.ToString());
}
if (style == Style.Centered)
{
key.SetValue(@"WallpaperStyle", 1.ToString());
key.SetValue(@"TileWallpaper", 0.ToString());
}
if (style == Style.Tiled)
{
key.SetValue(@"WallpaperStyle", 1.ToString());
key.SetValue(@"TileWallpaper", 1.ToString());
}
SystemParametersInfo(SPI_SETDESKWALLPAPER,
0,
tempPath,
SPIF_UPDATEINIFILE | SPIF_SENDWININICHANGE);
}
}
}