-2
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!

CR0W3
  • 9
  • 1

1 Answers1

0

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).

Paul Sanders
  • 24,133
  • 4
  • 26
  • 48