Large Icon display in Explorer view
-
I have created a Explorer type application in which i have problems in viewing the large icons.When i update the List view to display the files and folders in a particular path i am getting only the text display not the image. Any suggestion or article of this kind will be helpful Thanks
-
I have created a Explorer type application in which i have problems in viewing the large icons.When i update the List view to display the files and folders in a particular path i am getting only the text display not the image. Any suggestion or article of this kind will be helpful Thanks
If i understand u correctly u want to add an icon for ur tree component. U can choose between the two function i worked on before. the first function is for getting the icon from ur computer(The one specified in the folder option FileTypes Tab) HICON CMyTreeCtrl::GetIcon(CString pathFileName) { // Call SHGetFileInfo to get the icon. Call with dummy filename and // SHGFI_USEFILEATTRIBUTES flag, so file doesn't actually have to // exist. SHFILEINFO shfi; memset(&shfi,0,sizeof(shfi)); SHGetFileInfo(pathFileName, FILE_ATTRIBUTE_NORMAL, &shfi, sizeof(shfi), SHGFI_ICON| SHGFI_USEFILEATTRIBUTES| SHGFI_SHELLICONSIZE | SHGFI_SMALLICON); return shfi.hIcon; } And the second one if u want to customizeur own images: First create the icons then Create an imagelist and do the following m_imageList.Create(16,16,0,3,2); m_imageList.SetBkColor(RGB(255,255,255)); HICON hIcon; hIcon = AfxGetApp()->LoadIcon(IDI_ICON2); //Folder eg m_imageList.Add(hIcon); hIcon = AfxGetApp()->LoadIcon(IDI_ICON3); //File eg m_imageList.Add(hIcon); m_T.SetImageList(&m_imageList,TVSIL_NORMAL); I hope this helps /\|-||\/|/\|)
-
If i understand u correctly u want to add an icon for ur tree component. U can choose between the two function i worked on before. the first function is for getting the icon from ur computer(The one specified in the folder option FileTypes Tab) HICON CMyTreeCtrl::GetIcon(CString pathFileName) { // Call SHGetFileInfo to get the icon. Call with dummy filename and // SHGFI_USEFILEATTRIBUTES flag, so file doesn't actually have to // exist. SHFILEINFO shfi; memset(&shfi,0,sizeof(shfi)); SHGetFileInfo(pathFileName, FILE_ATTRIBUTE_NORMAL, &shfi, sizeof(shfi), SHGFI_ICON| SHGFI_USEFILEATTRIBUTES| SHGFI_SHELLICONSIZE | SHGFI_SMALLICON); return shfi.hIcon; } And the second one if u want to customizeur own images: First create the icons then Create an imagelist and do the following m_imageList.Create(16,16,0,3,2); m_imageList.SetBkColor(RGB(255,255,255)); HICON hIcon; hIcon = AfxGetApp()->LoadIcon(IDI_ICON2); //Folder eg m_imageList.Add(hIcon); hIcon = AfxGetApp()->LoadIcon(IDI_ICON3); //File eg m_imageList.Add(hIcon); m_T.SetImageList(&m_imageList,TVSIL_NORMAL); I hope this helps /\|-||\/|/\|)
Thanks for your reply. What exactly my problem is when i clicked the LARGE ICON Button on the applications tool bar or select it from the View menu the Icons are not getting displayed in the List view. I am able to see the icons in other views namely Details,Small Icons ,Lists. There's absolutely no problem with the tree view.
-
I have created a Explorer type application in which i have problems in viewing the large icons.When i update the List view to display the files and folders in a particular path i am getting only the text display not the image. Any suggestion or article of this kind will be helpful Thanks