🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Problem with ExtractIcon in BDS2006

#2541
From: FEEX
Date: Mon, 12 Feb 2007 14:48
38 lines
2458 bytes
Mike Collins wrote:
> Hay Feex....
> 
> Can you explain exactly what you are trying to do - i'm a bit confused by 
> what you are trying to achieve as your end goal.  I've messed on loads with 
> icons and other images under windows and then winXP - there are some key 
> issues with some of the api's and in my personal opinion, the way builder 
> creates its resources.
> 
> Perhaps i can provide some details if you can clarify what you are trying to 
> do - i might be totally braking up the wrong tree though.
> 
> Mike
> 

What we try to do is replace the existing icon in an SFX(EXE) file with 
another one of the same size. hat method worked well until BDS4 was used.

Meanwhile we found out (Russell Peters did) what caused all the trouble.
When the TIcon used its SaveToSteam method it uses the WriteIcon method( 
in Graphics.pas)
In previous BCB/Delphi versions this method was called with a 'Color' 
parameter = 4 resulting in a 16 color icon (if it was created that way)
BDS4 calls that method with a 'Color" value of -1 resulting in a icon 
with 64K colors.

As a solution we will write our own version of WriteIcon that will 
extract the icon with the desired 16 color version for further use.

I have done a number of tests with the UpdateResource API functions but 
the resulting EXE did not load anymore. I suppose because the EXE was 
compressed using the UPX tool.


-- 
Roger Aelbrecht
www.drehoeksw.net
www.bcbzip.net
Technical Details
Message-ID: <45d07e3a$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <45ca135e@newsgroups.borland.com> <45d05f1b$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,d31afbf0207af4b7
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
Date: Mon, 12 Feb 2007 15:48:44 +0100
From: FEEX <feex@drehoek.net>
User-Agent: Thunderbird 1.5.0.9 (Windows/20061207)
MIME-Version: 1.0
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: Re: Problem with ExtractIcon in BDS2006
References: <45ca135e@newsgroups.borland.com> <45d05f1b$1@newsgroups.borland.com>
In-Reply-To: <45d05f1b$1@newsgroups.borland.com>
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 87.66.89.156
Message-ID: <45d07e3a$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1171291706 87.66.89.156 (12 Feb 2007 06:48:26 -0800)
Lines: 38
Path: arc1-ca.pugleaf.net!g2news2.google.com!news3.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail