Article View: borland.public.cppbuilder.nativeapi
Article #16634Re: SHGetFileInfo and system image list
From: Dmitry Mikhilov
Date: Fri, 02 May 2003 06:00
Date: Fri, 02 May 2003 06:00
66 lines
4288 bytes
4288 bytes
Remy, I've checked icon indexes returned by SHGetFileInfo for each consecutive list item which shows information about particular file. Wrong icons start to appear when icon indexes for StateImages are greater than 14. For SmallImages there is no limit and everything is shown correctly. So, the range which "seems to be" safe for StateImages is only 1-14. Knowing this limitation, I will reorganize the interface and get rid of the idea to use StateImages voluntarily. Drawing something on a column headers isn't really a problem, but first of all I had to realize that in my case I can't do it "normally" via SmallImages :) It's a pity that in the help files for TListView it is only told that StateImages property "Provides a list of additional icon images to display next to each item in the list view" without mentioning any restrictions. Thank you very much for your time and patience. Dmitry "Remy Lebeau (TeamB)" <gambit47@yahoo.com> wrote: news:3eb196e8$1@newsgroups.borland.com... > > "Dmitry Mikhilov" <dm1@fromru.com> wrote in message > news:3eb18d9b@newsgroups.borland.com... > > > Remy, I understand what you mean, but the problem > > is that column headers take their images from SmallImages > > list, not from the StateImages one. > > Perhaps, but you have to be careful with the StateImages property. State > images have additional special processing on them, both by the ListView and > the OS in general. This is because state indexes are not true absolute > indexes in the ImageList. Firstly, they are 1-based, not 0-based. > Secondly, they are actually masked with other values, and as such they need > to be translated back to indexes when needed. In fact, now that I think > about it, that's probably why your images are getting messed up > periodically, since you've swapped the ImageLists so the ListView/OS is > probably ending up doing its extra processing on the wrong list. That would > probably produce the incorrect indexes you are seeing. > > > So, if I shall assign system image list to SmallImages > > of a listview, then how can I draw my own images > > (which are not part of system image list) at ListColumns? > > Honestly, I don't think you're going to be able to do what you're trying to > do, at least not by using the native behaviors. ListView controls simply > weren't designed to properly handle everything you're tying to throw at it > at once. You really should swap your ImageLists, but then you lose your > header images. Leave the ImageLists as they are so the header images work, > and you mess up your image indexes. You may have to simply disable the > ListView's native header and use a separate THeaderControl instead. Then > you can give the THeaderControl its own separate ImageList. But then you > have the new chore of keeping the two components in sync with each other if > the user resizes columns as such. Its a win-lose situation anyway you look > at it. > > > Gambit > >
Technical Details
Message-ID:
<3eb20988@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-01!sn-xit-09!supernews.com!iad-peer.news.verio.net!news.verio.net!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mailReferences:
<3eb0bdcd@newsgroups.borland.com> <18t1bv0lpjgqv1tblq09gh7u0j87hjtj2i@4ax.com> <3eb10399@newsgroups.borland.com> <3eb14f98$1@newsgroups.borland.com> <3eb15950@newsgroups.borland.com> <3eb1640d$1@newsgroups.borland.com> <3eb18101@newsgroups.borland.com> <3eb187be$1@newsgroups.borland.com> <3eb18d9b@newsgroups.borland.com> <3eb196e8$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,577f7a686a96c6b6 X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2003-05-01 23:07:30 PST From: "Dmitry Mikhilov" <dm1@fromru.com> Newsgroups: borland.public.cppbuilder.nativeapi References: <3eb0bdcd@newsgroups.borland.com> <18t1bv0lpjgqv1tblq09gh7u0j87hjtj2i@4ax.com> <3eb10399@newsgroups.borland.com> <3eb14f98$1@newsgroups.borland.com> <3eb15950@newsgroups.borland.com> <3eb1640d$1@newsgroups.borland.com> <3eb18101@newsgroups.borland.com> <3eb187be$1@newsgroups.borland.com> <3eb18d9b@newsgroups.borland.com> <3eb196e8$1@newsgroups.borland.com> Subject: Re: SHGetFileInfo and system image list Date: Fri, 2 May 2003 10:00:01 +0400 Lines: 68 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 NNTP-Posting-Host: 195.131.110.226 Message-ID: <3eb20988@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1051855240 195.131.110.226 (1 May 2003 23:00:40 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-01!sn-xit-09!supernews.com!iad-peer.news.verio.net!news.verio.net!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail