store icons in a dll

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Tal

    store icons in a dll

    Hi,

    i'm looking for a source code in java (or VB) that will get .ico
    files and store them in a .dll resorce file.
    sonthing like the ICONDLL.EXE program.

    10x,
    Tal.
  • Anders Lybecker

    #2
    Re: store icons in a dll

    > i'm looking for a source code in java (or VB) that will get .ico[color=blue]
    >files and store them in a .dll resorce file.
    >sonthing like the ICONDLL.EXE program.[/color]

    Here is some VB.NET code that generates a resource:

    Dim rw As New ResourceWriter( "Flags.resource s")

    Dim strFile As String
    Dim strInconName As String
    Dim img As Image

    For Each strFile In Directory.GetFi les("C:\Program Files\Microsoft
    Visual Studio .NET\Common7\Gr aphics\icons\Fl ags", "*.ico")
    strIconName = strFile.Substri ng(strFile.Leng th - 7, 3)
    img = Image.FromFile( strFile)
    rw.AddResource( strIconName, img)
    Next

    rw.Close()

    Then you can generate a dll with the Assembly Linker tool:
    al /embed:Flags.res ources /out:Flags.resou rces.dll

    That is it!

    :-)
    Anders Lybecker

    Comment

    Working...