用clistctrl和cimagelist就可以
if(!m_ImageList.Create(100, 90, ILC_COLOR24, 1, 1))
{
return FALSE
}
DeleteAllItems()
m_ImageList.SetBkColor(RGB(125,125,0))
if(SetImageList(&m_ImageList, LVSIL_NORMAL) == NULL)
{
return FALSE
}
如何创建浏览文件夹的对话框CString CXXXXDlg::GetOpenfolderPath()
{
BROWSEINFO bi
ZeroMemory(&bi,sizeof(BROWSEINFO))
bi.ulFlags = 0x0040 | BIF_EDITBOX
LPMALLOC pMalloc
LPITEMIDLIST pidl = SHBrowseForFolder(&bi)
CString strFolderPath = "" char savepath[MAX_PATH]
memset(savepath,0,sizeof(savepath)) if(pidl != NULL){
SHGetPathFromIDList(pidl,savepath)
strFolderPath.Format(_T("%s"), savepath)
f (SUCCEEDED(SHGetMalloc(&pMalloc))) {
pMalloc->Free(pidl)
pMalloc->Release()
}
} return strFolderPath
}
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)