我使用以下代码。我可以获取文件链接的文件名,但无法获取链接的名称。谁可以帮助我?
STDMETHODIMP CJhContextMenu::Initialize(LPCITEMIDLIST pidlFolder, LPDATAOBJECT pdtobj, HKEY hkeyProgID)
{
HRESULT hr;
UINT nFileCount;
UINT nLen,nLen1;
m_bFail = FALSE;
FORMATETC fmt = {CF_HDROP, NULL, DVASPECT_CONTENT, -1, TYMED_HGLOBAL };
STGMEDIUM sm = { TYMED_HGLOBAL };
hr = pdtobj->GetData(&fmt, &sm);
if (FAILED(hr))
{
m_bFail = TRUE;
return hr;
}
nLen = DragQueryFileA((HDROP)sm.hGlobal, 0, szFileName, sizeof(char) * MAX_PATH);
}