Heads up! This post was written 13 years ago. Some information might be outdated or may have changed since then.
#include "iostream"
#include "windows.h"
using namespace std;
int main() {
int result;
LPWSTR wpath = L"D:\\wallpaper\\02700_trifecta_1366x768.jpg";
result = SystemParametersInfo(SPI_SETDESKWALLPAPER, 0, wpath, SPIF_UPDATEINIFILE);
return 0;
} тествано с GNU GCC компилатор