C++ and STL
  Common Issues
  Destructor
  regex
  string
 MFC
  CButton
  CDialog
  CEdit
  CInternetSession
  CWinThread
  CWnd
 MS VS FAQ
  Compiling, building
  Debugging
  Editor
  Settings
 Win32, API
  Console
  File System
  Graphics
  Internet functions
  Kernel objects
  Security
  Sound
  Thread, process
  Window
 Windows NT/2K*
  Logon, logoff...
  Networking
  Service Packs
 | About
  About
  Links & Freeware

Powered by
CoderTown



How to get system's file extension associated icons?

Original idea was found at CodeGuru. I extracted the required source files and did some minor modifications. Example of how it can be used:

   CListCtrl serverListCtrl;   
   CShellList shellIconList;

   shellIconList.CreateImageList();
   serverListCtrl.SetImageList(&shellIconList.m_Small, LVSIL_SMALL);
   serverListCtrl.SetImageList(&shellIconList.m_Large, LVSIL_NORMAL);

   for(...) {
      icon = shellIconList.AddExtIcon(file->name);
      serverListCtrl.InsertItem(nCounter++, file->name, icon);
   }

Check out the FtpUpdate project on this site to see how it could be integrated.

Created: 2003-05-13
Updated: 2003-05-13

Google
 
Web visualcpp.net
msdn.microsoft.com codeguru.com