我用 C++ 在开始菜单中为 Windows 创建了一个 Internet 快捷方式。一切都很好,但我怎样才能向这个快捷方式添加工具提示?
我找不到类似于 ShellLink::SetDescription 的 shell 链接。
...
QString internetAddress = "http://www.blabla.de";
IUniformResourceLocator *pURL = NULL;
CoInitialize(NULL);
HRESULT hres;
hres = CoCreateInstance(CLSID_InternetShortcut, NULL,
CLSCTX_INPROC_SERVER, IID_IUniformResourceLocator, (LPVOID*)&pURL);
if(SUCCEEDED(hres))
{
IPersistFile *ppf = NULL;
hres = pURL->SetURL((LPCWSTR)internetAddress.utf16(), 0);
if(SUCCEEDED(hres))
{
hres = pURL->QueryInterface(IID_IPersistFile, (LPVOID*)&ppf);
if(SUCCEEDED(hres))
{
hres = ppf->Save((LPCWSTR)linkFilePath.utf16(), TRUE);
ppf->Release();
}
pURL->Release();
}
}
...