SharpDevelop Community

Get your problems solved!
Welcome to SharpDevelop Community Sign in | Join | Help
in Search

Icon library (ICL) within the executable

Last post 01-01-2007 9:54 PM by BrightSoul. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 12-28-2006 4:31 PM

    Icon library (ICL) within the executable

    Hello,
    I would like to assign many icons (or an .ICL file) to my application written with #Develop so that when the user searches the executable for icons he finds many to choose from.
     
    Basically, I want to do this because I need a number of icons to build some file associations.
    Take iTunes as an example. It contains an icon for each file type it can open.
     
     
     
    Thanks.
    Filed under:
  • 12-28-2006 8:32 PM In reply to

    Re: Icon library (ICL) within the executable

    The basic steps are:

     

    1. Create a Resource file (.rc) containing the icons you want to embed as resources, for example:
    2. #define ICO_APP        128
      #define ICO_DVD        129
      #define ICO_SVR        130
      #define ICO_SIM        131

      ICO_APP  ICON "App.ico"
      ICO_DVD  ICON "dvd-database.ico"
      ICO_SVR  ICON "ScreenSaver.ico"
      ICO_SIM  ICON "SimpSvr.ico"

       

    3. Compile the .rc file into a .res file using Microsoft's Resource Compiler Rc.exe, which is part of Microsoft's Platform SDK.
    4.  

    5. In SharpDevelop2, open your project. Open the project options (Project | Project Options). On the Application tab in the Win32 Resource File text box add the path to your .res file. Then build the project. The icons should be embedded in your app.

    Note that the lowest icon ID number in the .rc file (e.g. 128 above) will automatically become the application's icon.

    You could also make the compilation using Rc.exe a pre-build step so you don't have to remember to recompile when you add new icons. 

  • 01-01-2007 9:54 PM In reply to

    Re: Icon library (ICL) within the executable

    Thanks MattWard, it's working perfectly!
     
    You could also make the compilation using Rc.exe a pre-build step so you don't have to remember to recompile when you add new icons.
    I'll keep that in mind, thanks for great support.
    Happy new year!
Page 1 of 1 (3 items)
Powered by Community Server (Commercial Edition), by Telligent Systems
Don't contact us via this (fleischfalle@alphasierrapapa.com) email address.