Icons

J Chapman jc at ch.com
Sun Feb 27 01:23:47 PST 2011


== Quote from Joel Christensen (joelcnz at gmail.com)'s article
> On 27-Feb-11 11:24 AM, Joel Christensen wrote:
> > On 27-Feb-11 12:56 AM, J Chapman wrote:
> >> == Quote from Joel Christensen (joelcnz at gmail.com)'s article
> >>> I noticed in windows with D you can use .res (eg. dmd main.d smile.res)
> >>> files for icons any way. but how do you make icon .res files?
> >>
> >> With a resource compiler. Digital Mars supplies one as part of its C++
> >> utilities package: http://ftp.digitalmars.com/bup.zip.
> >>
> >> Documentation is here: http://www.digitalmars.com/ctg/rcc.html
> >
> Hmm. Can't seem to get it to work.

In what way?

I just tried it, and it works (mostly).

Add this to your resource script (eg "icons.rc"), where "myicon.ico" is the
path to the icon:
0001 ICON "myicon.ico"

Compile with the following command:
c:\dm\bin\rcc icons.rc

Then add the resulting "icons.res" to the command line when building your
app.

However, starting with Windows Vista, there's a new .ico format based on
PNG, which Digital Mars's rcc doesn't recognise. In which case you'll get
the following antiquated error:
"myicon.ico doesn't contain a valid Windows 3.0 icon resource

So if you see that error, use Microsoft's resource compiler (rc.exe) from
the Windows SDK instead.


More information about the Digitalmars-d-learn mailing list