"Note When the SPI_SETDESKWALLPAPER flag is used, SystemParametersInfo always returns TRUE." from
MSDN[
^].
There is a note about the
SPI_GETDESKWALLPAPER
function at the bottom of that page by Razeen2008. It basically says that the data type is WCHAR, not char.
(I have not tried this code)
#include "stdafx.h"
#include <stdio.h>
#include <windows.h>
#include <string.h>
#include <iostream.h>
int main(int argc, char* argv[]) {
WCHAR a[1024] = L"C:\\Documents and Settings\\All Users\\Documents\\My Pictures\\Sample Pictures\\Blue hills.jpg"; SystemParametersInfo(SPI_SETDESKWALLPAPER, 0, a, SPIF_SENDCHANGE);
return 0;
}