Article View: borland.public.cppbuilder.nativeapi
Article #16726Re: SHGetFileInfo and system image list
From: Dmitry Mikhilov
Date: Thu, 01 May 2003 20:17
Date: Thu, 01 May 2003 20:17
53 lines
3404 bytes
3404 bytes
"Remy Lebeau (TeamB)" <gambit47@yahoo.com> wrote:
>
> "Dmitry Mikhilov" <dm1@fromru.com> wrote in message
> news:3eb15950@newsgroups.borland.com...
>
> > Just adding TListItems and picking StateImage's
> > indexes for them...
>
> Any particular reason why you are using StateImages instead of just
Images?
> They are separate properties of the TListView.
Yes, I know. But I use SmallImages for representing the status of the files
(i.e. are they locked or not) which are either linked or embedded to
database whilst StateImages represent their filetypes (checkboxes are not
used, so stateimages are free); ListView is always in report mode. Also
SmallImages are used to show sorting marks on column headers.
I tried to swap image lists for SmallImages and StateImages, but in this
case wrong icons appeared as SmallImages, as you could possibly expect.
> Also, it is hard to tell from your code, but are you passing a full path
to
> SHGetFileInfo() when retrieving an index? I'm guessing that you are only
> passing a filename without any path as well.
Already tried both approaches before attempting to bother Borland community
:). Tried to point to really existing files giving their fully qualified
path without providing SHGFI_USEFILEATTRIBUTES flag; tried to pass only file
extensions and set SHGFI_USEFILEATTRIBUTES flag. Doesn't make any
difference.
And it happens on every computer where I attempt to launch my application...
> Also, when calling SHGetFileInfo(), you removed your SFGAO_SHARE flag.
You
> should leave that in there:
>
> FileIcons->Handle = SHGetFileInfo("", SFGAO_SHARE, &Si,
> sizeof(SHFILEINFO), SHGFI_SMALLICON | SHGFI_SYSICONINDEX);
> FileIcons->ShareImages = true;
Yes, I did it exactly in this way from the very beginning. SFGAO_SHARE was
removed when I tried to use the example provided by Nick Cassos.
Of course, FileIcons->ShareImages is set to true - this list doesn't own
images provided by Windows.
> SHGetFileInfo(FileName.c_str(), SFGAO_SHARE, &Si, sizeof(SHFILEINFO),
> SHGFI_ICON | SHGFI_SHELLICONSIZE | SHGFI_SYSICONINDEX | SHGFI_SMALLICON);
>
Exactly, but in vain :( I feel that the problem is very simple, but
nevertheless is beyond my comprehension...
Dmitry.
Technical Details
Message-ID:
<3eb18101@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!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>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 13:25:52 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> Subject: Re: SHGetFileInfo and system image list Date: Fri, 2 May 2003 00:17:31 +0400 Lines: 55 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: <3eb18101@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1051820289 195.131.110.226 (1 May 2003 13:18:09 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!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