www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Icons

reply Joel Christensen <joelcnz gmail.com> writes:
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?
Feb 26 2011
parent reply J Chapman <jc ch.com> writes:
== Quote from Joel Christensen (joelcnz 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
Feb 26 2011
parent reply Joel Christensen <joelcnz gmail.com> writes:
On 27-Feb-11 12:56 AM, J Chapman wrote:
 == Quote from Joel Christensen (joelcnz 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

Thanks Chapman. :-)
Feb 26 2011
parent reply Joel Christensen <joelcnz gmail.com> writes:
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 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.
Feb 26 2011
parent reply J Chapman <jc ch.com> writes:
== Quote from Joel Christensen (joelcnz 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 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



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.
Feb 27 2011
next sibling parent Joel Christensen <joelcnz gmail.com> writes:
Thanks, Chapman :-), I followed your instructions and they worked.
Feb 27 2011
prev sibling parent Joel Christensen <joelcnz gmail.com> writes:
I got it working with the DAllegro (Allegro 4.2) game library as well!
Feb 27 2011