Is there any reliable API to Get Windows Folder in Windows in C++? I am using the following way, however it failed.
BOOL CQUserInfoHelper::GetWindowsPath(CString& strWindowsPath)
{
TCHAR windowsPathTemp[MAX_PATH];
int nSize = MAX_PATH;
::GetWindowsDirectory(
windowsPathTemp,
nSize);
strWindowsPath = windowsPathTemp;
return TRUE;
}