获取系统临时目录
TCHAR szPath[300];
GetTempPath(300, szPath);
获取当前用户文档目录
TCHAR MyDocumentDir[MAX_PATH];
SHGetSpecialFolderPath(NULL, MyDocumentDir, CSIDL_PERSONAL, 0);
获取本程序绝对路径(由此可获得程序工作目录)
CString sPath;
GetModuleFileName( NULL, sPath.GetBufferSetLength(MAX_PATH + 1), MAX_PATH);
sPath.ReleaseBuffer();
获取快捷方式所链接的文件
CString PublicFunctions::GetFileLinkPath(CString strLink)
{
HRESULT hres;
CString strInfo;
if (strLink.Find(_T(".lnk")) == -1)
return strInfo;
CoInitialize(NULL);