WEB开发网
开发学院软件开发VC VC一点通:实现文件夹的缩略图显示 阅读

VC一点通:实现文件夹的缩略图显示

 2008-11-14 19:36:31 来源:WEB开发网   
核心提示: voidCPicViewView::GetItemInfo(LPCITEMIDLISTpidl,CFolderItemInfo*pItemInfo){HRESULThr=theApp.SHGetDisplayNameOf(pidl,pItemInfo->tszDispl



voidCPicViewView::GetItemInfo(LPCITEMIDLISTpidl,CFolderItemInfo*pItemInfo)
{
HRESULThr=theApp.SHGetDisplayNameOf(pidl,pItemInfo->tszDisplayName);
IShellIcon*pShellIcon=NULL;
hr=m_psfFolder->QueryInterface(IID_IShellIcon,(LPVOID*)&pShellIcon);
if(SUCCEEDED(hr)&&pShellIcon){
pShellIcon->GetIconOf(pidl,0,&pItemInfo->iIcon);
pShellIcon->Release();
}
IShellIconOverlay*pShellIconOverlay=NULL;
hr=m_psfFolder->QueryInterface(IID_IShellIconOverlay,(LPVOID*)&pShellIconOverlay);
if(SUCCEEDED(hr)&&pShellIconOverlay){
intnOverlay=0;
pShellIconOverlay->GetOverlayIndex(pidl,&nOverlay);
pItemInfo->state=INDEXTOOVERLAYMASK(nOverlay);
pShellIconOverlay->Release();
}
LPITEMIDLISTpidlItemFull=ILCombine(m_pidlFolder,pidl);
if(pidlItemFull){
if(SHGetPathFromIDList(pidlItemFull,pItemInfo->tszPath)){
USES_CONVERSION;
hr=OleLoadPicturePath(
T2OLE(pItemInfo->tszPath)
,NULL,0,RGB(255,255,255)
,IID_IPicture,(LPVOID*)&pItemInfo->pic.m_pPict);
if(FAILED(hr)){
pItemInfo->bFailLoadPic=TRUE;
TRACE("OleLoadPicturePathfailed%srn",pItemInfo->tszPath);
}
}
}
m_pMalloc->Free(pidlItemFull);
}
}

上一页  1 2 3 4 5 6  下一页

Tags:VC 一点通 实现

编辑录入:爽爽 [复制链接] [打 印]
赞助商链接