我有一个程序可以将用户的壁纸设置为文件。我需要获取图像文件的完整路径。
下面是我的代码
#include <windows.h>
int main()
{
FreeConsole();
const wchar_t *filenm = L"hay.jpg"; //Get path to hay.jpg
bool isWallSet = SystemParametersInfoW(SPI_SETDESKWALLPAPER, 0,
(void*)filenm, SPIF_UPDATEINIFILE);
return 0;
}
GetCurrentDirectory
获取该目录的绝对路径。 - Steadybox