Re: Using Win32Lib's geFileInfo to show system icon

new topic     » goto parent     » topic index » view thread      » older message » newer message

I think I may have answered my own question.  What I realized is that Win32Lib
maintains it's own image list and any icons used for tree/list views must be in
that list.  SO...I added the handle to the small icon returned from getFileInfo
to the image list and it worked!  Here's the code:

file_info = getFileInfo(trim(dir_data[i][2]),
                        FILE_ATTRIBUTE_NORMAL,
                        or_all({SHGFI_USEFILEATTRIBUTES,
                                SHGFI_ICON,
                                SHGFI_SMALLICON}))
il_index = addIcon(file_info[4])                    
void = addTVItem(MainTV, il_index, il_index,
                 trim(dir_data[i][2]), index)


What I don't know is if identical icons are added to the list if they already
exist.  Could this potentially become a resource problem/leak?

Jonas Temple
http://www.yhti.net/~jktemple

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu