Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. change the exe application icon on runtime

change the exe application icon on runtime

Scheduled Pinned Locked Moved C#
csharpvisual-studiohelplounge
8 Posts 4 Posters 2 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    jojoba20
    wrote on last edited by
    #1

    I need to change the icon of the resulting .exe for my application programmatically at runtime. The path to the icon will be read form a file. I know it's possible to change the icon through: Project >> Properties >> Common Properties >> General >> Application Icon. I was reading at msdn to find the answer. It seems possible to change it but I just couldn't understand how. If anyone has done this before any help would be appriciated. I'm using Microsoft Visual Studio .NET 2008

    OriginalGriffO 1 Reply Last reply
    0
    • J jojoba20

      I need to change the icon of the resulting .exe for my application programmatically at runtime. The path to the icon will be read form a file. I know it's possible to change the icon through: Project >> Properties >> Common Properties >> General >> Application Icon. I was reading at msdn to find the answer. It seems possible to change it but I just couldn't understand how. If anyone has done this before any help would be appriciated. I'm using Microsoft Visual Studio .NET 2008

      OriginalGriffO Offline
      OriginalGriffO Offline
      OriginalGriff
      wrote on last edited by
      #2

      Set the Icon property of your form - that alters the runtime icon shown in the control box at the top left, and the taskbar.

      Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...

      "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
      "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt

      J 1 Reply Last reply
      0
      • OriginalGriffO OriginalGriff

        Set the Icon property of your form - that alters the runtime icon shown in the control box at the top left, and the taskbar.

        Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...

        J Offline
        J Offline
        jojoba20
        wrote on last edited by
        #3

        I wanna the exe icon change!!

        L OriginalGriffO 2 Replies Last reply
        0
        • J jojoba20

          I wanna the exe icon change!!

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          You cannot, it is technically not possible. What you are seeing is a "link" to that file, and yes, that can have its own icon.

          Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^][](X-Clacks-Overhead: GNU Terry Pratchett)

          J 1 Reply Last reply
          0
          • J jojoba20

            I wanna the exe icon change!!

            OriginalGriffO Offline
            OriginalGriffO Offline
            OriginalGriff
            wrote on last edited by
            #5

            You have been here four years - that's long enough for you to know that you need to tell us what you want because we can't see your screen, access your HDD, or read your mind. So explain: which icon do you want to change at run time (there are several places your app icon can appear)? Where? When? And probably most important, why?

            Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...

            "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
            "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt

            1 Reply Last reply
            0
            • L Lost User

              You cannot, it is technically not possible. What you are seeing is a "link" to that file, and yes, that can have its own icon.

              Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^][](X-Clacks-Overhead: GNU Terry Pratchett)

              J Offline
              J Offline
              jojoba20
              wrote on last edited by
              #6

              I googled and got the link below .But i cant run and get error. http://stackoverflow.com/questions/4127785/using-updateresource-in-c[^]

              L D 2 Replies Last reply
              0
              • J jojoba20

                I googled and got the link below .But i cant run and get error. http://stackoverflow.com/questions/4127785/using-updateresource-in-c[^]

                L Offline
                L Offline
                Lost User
                wrote on last edited by
                #7

                Perhaps other readers might be wondering "what error" :confused:

                Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^][](X-Clacks-Overhead: GNU Terry Pratchett)

                1 Reply Last reply
                0
                • J jojoba20

                  I googled and got the link below .But i cant run and get error. http://stackoverflow.com/questions/4127785/using-updateresource-in-c[^]

                  D Offline
                  D Offline
                  Dave Kreskowiak
                  wrote on last edited by
                  #8

                  That's nice and all, but you can NOT change the icon of your .EXE while it's running. The file is locked by the system until the .EXE quits. You have to change it from another executable in order for this to work.

                  A guide to posting questions on CodeProject

                  Click this: Asking questions is a skill. Seriously, do it.
                  Dave Kreskowiak

                  1 Reply Last reply
                  0
                  Reply
                  • Reply as topic
                  Log in to reply
                  • Oldest to Newest
                  • Newest to Oldest
                  • Most Votes


                  • Login

                  • Don't have an account? Register

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • World
                  • Users
                  • Groups