SetWindowsWallpaper

Have you ever wanted to programatically set your Windows wallpaper, but didn't want to download some 68MB library to do so?

Suffer no more! Use this tiny C program, precompiled (in 2007, compiler unknown) for your convenience.

Usage: setwallpaper path-to-image-file

In ancient times, the image file had to be a Windows bitmap .bmp. Newer versions of Windows may accept JPEGs or other formats.

Files:

Filename Size Description SHA-1
setwallpaper.c 350 source code; very sophistication; wow 62f31482dfaa21541b5e9a6d261aa549e832e3d3
setwallpaper.exe 40476 32-bit executable; hash hasn't changed 17 years. Probably safe? 35678682ab2f935588dc56c0b2ce61e66ff56f74

To avoid making you click, here's the source code:

#include <windows.h>
#include <stdio.h>

const char *USAGE =
"Junko2 SetWindowsWallpaper program, 2007-03-20\n"
"Usage: setwallpaper <path-to-bmp-file>\n";

int main(int argc, char **argv) {
    if( argc < 2 ) {
	fputs( USAGE, stderr );
	return 1;
    }
    SystemParametersInfo(SPI_SETDESKWALLPAPER, 0, argv[1], SPIF_UPDATEINIFILE);
    return 0;
}