Embed Multiple Icons in MY EXE (VB.NET Program)

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

    Embed Multiple Icons in MY EXE (VB.NET Program)

    I would like to embed mutiple icons inside my main exe file so that they can
    be viewed like
    Shell32.dll or whatever.

    Can't figure out how to do this.

    Sorry if this is in the wrong group. Wasn't sure where to ask..

    Thanks,

    Shane

    end result---for one thing.. I want doc associations in my setup to be able
    to choose from an icon in the exe.


  • Herfried K. Wagner [MVP]

    #2
    Re: Embed Multiple Icons in MY EXE (VB.NET Program)

    * "Shane Story" <TheStorys@TAKE OUTTHISSPAMBUST ERsofthome.net> scripsit:[color=blue]
    > I would like to embed mutiple icons inside my main exe file so that they can
    > be viewed like
    > Shell32.dll or whatever.[/color]

    This is not possible with the IDE. You will have to use the command
    line compiler ("vbc.exe"):

    <http://mvps.org/dotnet/dotnet/samples/codingtechnique/downloads/ResourceIcons.z ip>

    --
    Herfried K. Wagner [MVP]
    <http://www.mvps.org/dotnet>

    Comment

    • Mick Doherty

      #3
      Re: Embed Multiple Icons in MY EXE (VB.NET Program)

      You can open the compiled executable in the IDE and add Icon resources. The
      only problem here is that if you recompile the project, the Icons will
      dissapear and you will have to do it again.

      "Herfried K. Wagner [MVP]" <hirf-spam-me-here@gmx.at> wrote in message
      news:%23fj3JCdx DHA.2440@TK2MSF TNGP12.phx.gbl. ..[color=blue]
      > * "Shane Story" <TheStorys@TAKE OUTTHISSPAMBUST ERsofthome.net> scripsit:[color=green]
      > > I would like to embed mutiple icons inside my main exe file so that they[/color][/color]
      can[color=blue][color=green]
      > > be viewed like
      > > Shell32.dll or whatever.[/color]
      >
      > This is not possible with the IDE. You will have to use the command
      > line compiler ("vbc.exe"):
      >
      >[/color]
      <http://mvps.org/dotnet/dotnet/sample...ds/ResourceIco
      ns.zip>[color=blue]
      >
      > --
      > Herfried K. Wagner [MVP]
      > <http://www.mvps.org/dotnet>[/color]


      Comment

      • Herfried K. Wagner [MVP]

        #4
        Re: Embed Multiple Icons in MY EXE (VB.NET Program)

        * "Mick Doherty" <EXCHANGE#WITH@ AND.REMOVE.SQUA REBRACKETS.[mdaudi100#ntlwo rld.com]> scripsit:[color=blue]
        > You can open the compiled executable in the IDE and add Icon resources. The
        > only problem here is that if you recompile the project, the Icons will
        > dissapear and you will have to do it again.[/color]

        Would be interesting if this can be automated using an add-in. The
        icons can be added with p/invoke calls to 'UpdateResource ' too...

        --
        Herfried K. Wagner [MVP]
        <http://www.mvps.org/dotnet>

        Comment

        • Shane Story

          #5
          Re: Embed Multiple Icons in MY EXE (VB.NET Program)

          Can you not use the ResEdit that comes with VSNET2003 to produce a res file?

          it only produces .resx and .resources---is .resources the same as .res?

          If so I should create it there and maybe add an external tool that calls vbc
          on the app or something.

          What a pain.

          Looks like MS would have thought of this. For now I will just ship the
          icons as ico files I guess.

          Seems everything with MS is 85% excellent but the 15% that should have been
          done to make a simple app is always missing. :(

          Any more Ideas appreciated.

          Shane

          "Herfried K. Wagner [MVP]" <hirf-spam-me-here@gmx.at> wrote in message
          news:%23fj3JCdx DHA.2440@TK2MSF TNGP12.phx.gbl. ..[color=blue]
          > * "Shane Story" <TheStorys@TAKE OUTTHISSPAMBUST ERsofthome.net> scripsit:[color=green]
          > > I would like to embed mutiple icons inside my main exe file so that they[/color][/color]
          can[color=blue][color=green]
          > > be viewed like
          > > Shell32.dll or whatever.[/color]
          >
          > This is not possible with the IDE. You will have to use the command
          > line compiler ("vbc.exe"):
          >
          >[/color]
          <http://mvps.org/dotnet/dotnet/sample...ds/ResourceIco
          ns.zip>[color=blue]
          >
          > --
          > Herfried K. Wagner [MVP]
          > <http://www.mvps.org/dotnet>[/color]


          Comment

          • Mick Doherty

            #6
            Re: Embed Multiple Icons in MY EXE (VB.NET Program)

            In fact UpdateResource may be the way to go, since the IDE seems to Flatten
            Alpha Icons, just as the framework in general does. Must be about time MS
            sorted that out.

            "Herfried K. Wagner [MVP]" <hirf-spam-me-here@gmx.at> wrote in message
            news:eGz1M2lxDH A.2520@TK2MSFTN GP10.phx.gbl...[color=blue]
            > * "Mick Doherty"[/color]
            <EXCHANGE#WITH@ AND.REMOVE.SQUA REBRACKETS.[mdaudi100#ntlwo rld.com]> scripsit:[color=blue][color=green]
            > > You can open the compiled executable in the IDE and add Icon resources.[/color][/color]
            The[color=blue][color=green]
            > > only problem here is that if you recompile the project, the Icons will
            > > dissapear and you will have to do it again.[/color]
            >
            > Would be interesting if this can be automated using an add-in. The
            > icons can be added with p/invoke calls to 'UpdateResource ' too...
            >
            > --
            > Herfried K. Wagner [MVP]
            > <http://www.mvps.org/dotnet>[/color]


            Comment

            • Herfried K. Wagner [MVP]

              #7
              Re: Embed Multiple Icons in MY EXE (VB.NET Program)

              * "Shane Story" <TheStorys@TAKE OUTTHISSPAMBUST ERsofthome.net> scripsit:[color=blue]
              > Can you not use the ResEdit that comes with VSNET2003 to produce a res file?
              >
              > it only produces .resx and .resources---is .resources the same as .res?[/color]

              That are .NET resources, we are talking about "old" Win32 resources.
              You can create RC and RES files using VS.NET directly ("File" -> "New"
              -> "File..." -> "Resource Template").
              [color=blue]
              > If so I should create it there and maybe add an external tool that calls vbc
              > on the app or something.
              >
              > What a pain.
              >
              > Looks like MS would have thought of this. For now I will just ship the
              > icons as ico files I guess.[/color]

              Would be nice if it was possible to edit the command line VS.NET uses
              for compilation like in C# in the project properties.

              --
              Herfried K. Wagner [MVP]
              <http://www.mvps.org/dotnet>

              Comment

              • Herfried K. Wagner [MVP]

                #8
                Re: Embed Multiple Icons in MY EXE (VB.NET Program)

                * "Mick Doherty" <EXCHANGE#WITH@ AND.REMOVE.SQUA REBRACKETS.[mdaudi100#ntlwo rld.com]> scripsit:[color=blue]
                > In fact UpdateResource may be the way to go, since the IDE seems to Flatten
                > Alpha Icons, just as the framework in general does. Must be about time MS
                > sorted that out.[/color]

                ACK. The icon support is "poor"...

                ;-(

                --
                Herfried K. Wagner [MVP]
                <http://www.mvps.org/dotnet>

                Comment

                • Shane Story

                  #9
                  Re: Embed Multiple Icons in MY EXE (VB.NET Program)

                  fix 100 things wrong with visual studio and break 50 that worked before...
                  ??
                  :)

                  -Shane
                  "Herfried K. Wagner [MVP]" <hirf-spam-me-here@gmx.at> wrote in message
                  news:eKPlrSnxDH A.2000@TK2MSFTN GP11.phx.gbl...[color=blue]
                  > * "Shane Story" <TheStorys@TAKE OUTTHISSPAMBUST ERsofthome.net> scripsit:[color=green]
                  > > Can you not use the ResEdit that comes with VSNET2003 to produce a res[/color][/color]
                  file?[color=blue][color=green]
                  > >
                  > > it only produces .resx and .resources---is .resources the same as .res?[/color]
                  >
                  > That are .NET resources, we are talking about "old" Win32 resources.
                  > You can create RC and RES files using VS.NET directly ("File" -> "New"
                  > -> "File..." -> "Resource Template").
                  >[color=green]
                  > > If so I should create it there and maybe add an external tool that calls[/color][/color]
                  vbc[color=blue][color=green]
                  > > on the app or something.
                  > >
                  > > What a pain.
                  > >
                  > > Looks like MS would have thought of this. For now I will just ship the
                  > > icons as ico files I guess.[/color]
                  >
                  > Would be nice if it was possible to edit the command line VS.NET uses
                  > for compilation like in C# in the project properties.
                  >
                  > --
                  > Herfried K. Wagner [MVP]
                  > <http://www.mvps.org/dotnet>[/color]


                  Comment

                  Working...