直接上代码:
bool ChangeLinkIcon(const CString &strLnkName, const CString &strIconPath)
{if (strLnkName.IsEmpty() || strIconPath.IsEmpty())
{
return false;
}
HRESULT hres;
IShellLink *psl = NULL;
IPersistFile *pPf = NULL;
int id;
LPITEMIDLIST pidl;
bool bRet = false;
do
{
hres = CoInitialize(NULL);
if (FAILED(hres))
{
break;
}
hres = CoCreate