![](https://i-blog.csdnimg.cn/blog_migrate/8f900a89c6347c561fdf2122f13be562.gif)
![](https://i-blog.csdnimg.cn/blog_migrate/961ddebeb323a10fe0623af514929fc1.gif)
#include <shlobj.h> bool ReadShortcut(LPWSTR lpwLnkFile, LPSTR lpDescFile) { bool bReturn = true; IShellLink *pShellLink; if(bReturn) { bReturn = (CoInitialize(NULL) == S_OK); if(bReturn) { bReturn = CoCreateInstance (CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER, IID_IShellLink, (void **)&pShellLink) >= 0; if(bReturn) { IPersistFile *ppf; bReturn = pShellLink->QueryInterface(IID_IPersistFile, (void **)&ppf) >= 0; if(bReturn) { bReturn = ppf->Load(lpwLnkFile, TRUE) >= 0; if(bReturn) { pShellLink->GetPath(lpDescFile, MAX_PATH, NULL, 0); } ppf->Release (); } pShellLink->Release (); } CoUninitialize(); } } return bReturn; } // 测试代码: char szBuf[MAX_PATH]; ReadShortcut(L"C:\\GLWorld.lnk", szBuf); MessageBox(0, szBuf, "", 0);