Retrieving Shell Icons

Francesco scrutinizer at gmx.at
Wed Feb 18 16:39:08 EST 2004


Hello,

(sorry, I have already asked this, but it is still unsolved)

I want to display the icons associated with a given extensions
  (also parent folder and folder) for my little filemanager in a
virtual list control.

I know, wxMimeTypesManager, unfortunatly, I cannot use it (i need
indexes
beginning from zero for the imagelist, and I'm not able to get
directory icons)

With win32 extension, I didn't come clear also:

The indexes, which i get from:

  dwFlags = Globals.SHGFI_USEFILEATTRIBUTES |
Globals.SHGFI_SYSICONINDEX | Globals.SHGFI_SMALLICON |
Globals.SHGFI_ICON
  windll.shell32.SHGetFileInfo (item.GetName(),
win32con.FILE_ATTRIBUTE_NORMAL,
    byref(Globals.shfileinfo), sizeof(Globals.shfileinfo), dwFlags)
  item.m_nIconIdx = Globals.shfileinfo.iIcon
 
(for example 9 for exe's, 8 html, 7 txt, 4 directories ...)

should correspond to the icons in the list

  dwFlags = Globals.SHGFI_USEFILEATTRIBUTES |
Globals.SHGFI_SYSICONINDEX | Globals.SHGFI_SMALLICON
  m_hImageList = windll.shell32.SHGetFileInfo('.txt',
win32file.FILE_ATTRIBUTE_NORMAL, byref(Globals.shfileinfo),
sizeof(Globals.shfileinfo), dwFlags)

In wxwindow, it is easy; but in wxPython (?)

Problem is: i get only a int pointer to the iconlist.
Can I transform this, to pass it into the image list; or is there
another solution?

Thank you for any help!

-- 
Francesco



More information about the Python-list mailing list