Menu

#2 AddIconsFromModule fails to load all icons

open
nobody
None
5
2005-01-20
2005-01-20
Anonymous
No

Invoking ImageListAddIconsFromModule fails to load all
icons from a dll, such as shell32. This dll has gaps in it
and these cause the routine to fail before loading all
icons.

To fix the problem, I updated comctl.ImageList so that
AddIconsFromModule only failed when the trapped
WindowsError.errno was not 1813 (no resource found?),
as follows:

while 1:
try:
hIcon=LoadImage(hdll,i,IMAGE_ICON,cx,cy,uFlags)
self.AddIcon(hIcon)
except WindowsError, we:
if we.errno != 1813:
break
i += 1

Discussion


Log in to post a comment.