I have tried all of the solution specified on these posts:
- How to change the windows 10 wallpaper with C++?
- How to change desktop background using VC++
- SystemParametersInfo sets wallpaper completly black (using SPI_SETDESKWALLPAPER)
And i still cant seem to be able to get it working.... heres my code:
const wchar_t* path = L"C:\\imagge.png";
bool result = SystemParametersInfoW(SPI_SETDESKWALLPAPER, 0, (void*)path, SPIF_UPDATEINIFILE);
std::cout << result;
Also if i specify a path that aint valid it still prints 1(true) when it clearly states on docs SPI_SETDESKWALLPAPER bit that it should return 0(false) if theirs a problem
Also i have tried calling printing out GetLastError();
and it returns 0....
Note When the SPI_SETDESKWALLPAPER flag is used, SystemParametersInfo returns TRUE unless there is an error (like when the specified file doesn't exist).