🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #177

Re: Loading x48 icons with ExtractIconEx...

#177
From: Mike Collins
Date: Tue, 01 Jul 2008 12:07
43 lines
2677 bytes
Hay Bob, thanks for the pointers and links.

I had actually looked at these two API's, along with a a whole list of 
others.  However, the problem (as i see it) is this:

1) I want to extract and display the default icon that is displayed for an 
executable program.  In BCB this would be "MAINICON" and in most other 
applications I think it is the icon with the ID 101 (but i'm not sure here). 
I don't want to get the shells associated icon which is displayed if not 
icon is embedded for a program.  Therefore, both SHGetFileInfo and 
ExtractAssociatedIcon will not work, becuase both look at the association 
between the .exe extension and the shell icons.

2) The problem with using LoadImage is that i need to provide it with 
lpszName value to identify the icon that i want to return.  So the question 
is, what value do i provide?  Is the default icon always 101?  In BCB / 
Delphi applications it is "MAINICON".  So based on the fact that i have a 
list of random applications, how do i determine the idetifier of the default 
icon?

Any ideas?

Many thanks

Mike

"Bob Gonder" <none@nowhere.invalid> wrote in message 
news:d73j6491uh8j0ess67ai2ht5jdkj5remsf@4ax.com...
> Mike Collins wrote:
>
>>displays a x48 icon that corrisponds to the application.  Currently i'm
>>using ExtractIconEx() becuase this seems like the only to get the default
>>icon used for an applicaiton, i.e.
>> however, i only get the x32 icon.
>
> Does ExtractAssociatedIcon work for you?
> Also you might look at SHGetFileInfo.
> I seem to remember that LoadImage was the one to use.
> Fairly good info here:
> Icons in Win32
> http://msdn.microsoft.com/en-us/library/ms997538.aspx
>
> 
Technical Details
Message-ID: <486a0d3d$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!proxad.net!feeder1-2.proxad.net!194.25.134.126.MISMATCH!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <486960ab@newsgroups.borland.com> <d73j6491uh8j0ess67ai2ht5jdkj5remsf@4ax.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,bcbc54027817c35e
X-Google-Attributes: gid10cc67,domainid0,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Mike Collins" <its@TheBottomOfThePost>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <486960ab@newsgroups.borland.com> <d73j6491uh8j0ess67ai2ht5jdkj5remsf@4ax.com>
Subject: Re: Loading x48 icons with ExtractIconEx...
Date: Tue, 1 Jul 2008 12:07:39 -0000
Lines: 45
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.3790.3959
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.4133
NNTP-Posting-Host: 84.13.93.69
Message-ID: <486a0d3d$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1214909757 84.13.93.69 (1 Jul 2008 03:55:57 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!proxad.net!feeder1-2.proxad.net!194.25.134.126.MISMATCH!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail