From: http://blog.csdn.net/chinabinlang/article/details/8637362
方法一:来自网络;
CString getMyDoc() // 获取“我的文档”路径
{
TCHAR m_lpszDefaultDir[MAX_PATH] = {0};
TCHAR szDocument[MAX_PATH] = {0};
memset(m_lpszDefaultDir, 0, _MAX_PATH);
LPITEMIDLIST pidl = NULL;
SHGetSpecialFolderLocation(NULL, CSIDL_PERSONAL, &pidl);
if (pidl && SHGetPathFromIDList(pidl, szDocument))
{
GetShortPathName(szDocument, m_lpszDefaultDir, _MAX_PATH);
}
return CString(szDocument);
}......
阅读全文