Each Windows feature has 2 versions:
SystemParametersInfoA()
A version ending in W is a version of the wide character type function (i.e., Unicode). All the \ 0 you see is because each character you return is in Unicode - 16 bytes per character - the second byte is 0. Therefore, you need to save the result in a wchar_t array and use wprintf instead of printf
wchar_t oldWallPaper[MAX_PATH]; result = SystemParametersInfo(SPI_GETDESKWALLPAPER, MAX_PATH-1, oldWallPaper, 0); wprintf( L"Current desktop background is %s\n", oldWallPaper );
So you can use version A SystemParametersInfoA() if you are not using Unicode. However, you should always use Unicode for recording.
Typically, SystemParametersInfo() is a macro that evaluates the version of W if UNICODE is defined on your system.
source share