【发布时间】:2021-05-01 21:41:04
【问题描述】:
string s = "C:\\ok.bmp";
SystemParametersInfo(SPI_SETDESKWALLPAPER, 0, (void*)s.c_str(), SPIF_SENDCHANGE);
这不起作用 ^^ 并且 ok.bmp 在文件夹中!
【问题讨论】:
标签: c++
string s = "C:\\ok.bmp";
SystemParametersInfo(SPI_SETDESKWALLPAPER, 0, (void*)s.c_str(), SPIF_SENDCHANGE);
这不起作用 ^^ 并且 ok.bmp 在文件夹中!
【问题讨论】:
标签: c++
现在大多数构建都是 Unicode,所以尝试使用 Unicode 字符串:
wstring ws = L"C:\\ok.bmp";
SystemParametersInfo(SPI_SETDESKWALLPAPER, 0, ws.data(), SPIF_SENDCHANGE);
(通过使用std::wstring::data(),您不需要演员表)。
【讨论】: