1、如何得到桌面图标的LIST。
2、如何更改图标,如:更改桌面上一个快捷方式的图标。
最好能给个例子。谢谢!
2、如何更改图标,如:更改桌面上一个快捷方式的图标。
最好能给个例子。谢谢!
解决方案 »
- webbrowser如何清空cookies
- 从程序拖动到explorer
- CWinThread派生的线程类关闭时要执行一些操作,该怎么做?
- 帮忙看看一个关于线程的错误
- 在 IDL 文件中如何添加 HKEY 类型的支持?
- 请问Win98是否支持COM+?
- 大侠救命!vc 中如何将一个word文件中的一段复制到另一个word文件?
- 急求activex密码控件的开发文档,在线急等,谢谢!
- SHFileOperation函数如何复制多个文件到一个目录
- 如何在LISTREPORT中去掉ImageList
- 关于映射驱动器?
- 我增加了一个继承自CFormView的类,然后想把它增加到文档模板中,可是却不知道如何增加
2. 枚举该目录内文件(一般是.lnk文件)
3. 分析快捷方式文件(CSDN上有很多文章关于快捷方式,搜索IShellLink),可以取得icon和修改icon
2、参考:
创建快捷方式
HRESULT CreateLink(LPCSTR lpszPathObj,
LPSTR lpszPathLink,
LPSTR lpszDesc)
{
HRESULT hres;
IShellLink* psl;
CoInitialize(NULL);
// Get a pointer to the IShellLink interface.
hres = CoCreateInstance(CLSID_ShellLink, NULL,
CLSCTX_INPROC_SERVER,
IID_IShellLink,
(void **)&psl);
if (SUCCEEDED(hres))
{
IPersistFile* ppf;
// Set the path to the shortcut target and add the
// description.
psl->SetPath(lpszPathObj);
psl->SetDescription(lpszDesc);
// Query IShellLink for the IPersistFile interface for saving the
// shortcut in persistent storage.
hres = psl->QueryInterface(IID_IPersistFile, (void **)&ppf);
if (SUCCEEDED(hres))
{
WORD wsz[MAX_PATH]; // Ensure that the string is ANSI.
MultiByteToWideChar(CP_ACP, 0, lpszPathLink, -1,wsz, MAX_PATH);
// Save the link by calling IPersistFile::Save.
hres = ppf->Save(wsz, TRUE);
ppf->Release();
}
psl->Release();
}
return hres;
}
枚举该目录内文件(一般是.lnk文件)通过什么函数来实现枚举?char s[255];
SHGetSpecialFolderPath(this->m_hWnd,s,CSIDL_DESKTOPDIRECTORY,TRUE);我通过上面获得了DESKTOP的目录,也找到了IShellLink的相关文章。
帮忙解释一下!