Thread: Resource Scripts in Mingw (Dev-C++)

  1. #1
    ¡Amo fútbol!
    Join Date
    Dec 2001
    Posts
    2,138

    Resource Scripts in Mingw (Dev-C++)

    Does anyone see any problem with this statement for an ICON.

    MyIcon ICON icon.ico

    icon.ico is located in the same directory as the program.

    BTW, Ken Fitlike, didn't you use to have a reference for Mingw resource scripts on your site? I looked for it but couldn't find it.

  2. #2
    ¡Amo fútbol!
    Join Date
    Dec 2001
    Posts
    2,138
    BTW, I made the icon with paint. It is a 32 by 32 pixel bitmap. Is that the correct format?

  3. #3
    erstwhile
    Join Date
    Jan 2002
    Posts
    2,227
    Icons and bitmaps have different file formats; icons contain, in addition to other info, an image bitmap and a monochrome mask. So creating a bitmap and changing its file extension to 'ico' doesn't give you an icon as the image is still a bitmap. However i'm not sure if you can get away with using a bitmap in this way; i'd be interested to know if you get it to work.

    The resource definition for an icon (image) is:

    ICON nameID, filename

    where nameID is a 16 bit unsigned int (0-65535) and filename is a valid filename for the icon file. So assuming that 'MyIcon' is a valid 'nameID' your syntax looks ok except as follows:

    Devc++4/4.01 requires the full path name to the icon resource. This is an idiosyncrasy of the ide and not of the underlying mingw resource compiler (windres).

    Although the latest Devc++beta5(4.9.7?) permit relative paths you might have to fiddle around about because if you include your own resource script devc++ seems to insist on creating its own anyway and simply including a path to your inserted resource script in it. If this is your situation then make the path to the icon relative to the devc++ resource script and not your own. In any event the full path, as mentioned above for devc++4/4.01 should work ok.

    In case you are interested, Fordy posted a link to a free gui resource editor at flashdaddee which, although older and sporting a hideously ugly and unfashionable interface, works fine but you'll have to hand tweak the resource scripts it produces. It has an icon editor with it which can be used to create 16 colour icons (maybe others?).

    >>BTW, Ken Fitlike, didn't you use to have a reference for Mingw resource scripts on your site? I looked for it but couldn't find it.<<

    I did but have removed it because it needs updating. You will find all the information that was in it on msdn, except the resource compiler specific examples/discussion (the ICON syntax, in particular, is different). Google should also provide useful info for any resource definition statement you choose to look further into.

    Hope that helps.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Dev Resource problem
    By algi in forum Windows Programming
    Replies: 3
    Last Post: 04-19-2005, 03:53 PM
  2. MinGW Studio Resource Editor
    By Vicious in forum Windows Programming
    Replies: 0
    Last Post: 09-11-2004, 07:49 PM
  3. Replies: 1
    Last Post: 09-06-2004, 10:45 AM
  4. Resource Files with Dev C++
    By EasterEggs in forum Windows Programming
    Replies: 2
    Last Post: 07-18-2004, 07:40 PM
  5. MinGW Resource
    By Okiesmokie in forum Windows Programming
    Replies: 1
    Last Post: 03-05-2002, 08:32 PM