string s = "C:\\ok.bmp";
SystemParametersInfo(SPI_SETDESKWALLPAPER, 0, (void*)s.c_str(), SPIF_SENDCHANGE);
This doesnt work ^^ and the ok.bmp is inside of the folder!
Most builds are Unicode nowadays, so try with a Unicode string:
wstring ws = L"C:\\ok.bmp";
SystemParametersInfo(SPI_SETDESKWALLPAPER, 0, ws.data(), SPIF_SENDCHANGE);
(by using std::wstring::data()
, you don't need the cast).