SHGetKnownFolderPath
SHGetKnownFolderPath is a Windows Shell API function that retrieves the full path of a known folder identified by a KNOWNFOLDERID GUID. It is part of the Known Folder API, introduced to provide stable, user- and system-permission aware locations for common data and settings. This API is commonly used as an improvement over earlier folder-path retrieval functions and is supported on Windows Vista and newer.
The function signature is HRESULT SHGetKnownFolderPath(REFKNOWNFOLDERID rfid, DWORD dwFlags, HANDLE hToken, PWSTR ppszPath). The rfid parameter
On success, the function returns S_OK and ppszPath points to the path string. On failure, an HRESULT
Usage typically requires including ShlObj.h and linking against Shell32.lib. Known folder IDs are defined as GUIDs,