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 / C++ / MFC
  4. how to replace icon resource from ico file.

how to replace icon resource from ico file.

Scheduled Pinned Locked Moved C / C++ / MFC
tutorialannouncementlearning
2 Posts 2 Posters 0 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.
  • X Offline
    X Offline
    Xiaodi_Liu
    wrote on last edited by
    #1

    Now I can replace icon resource in a .exe file from other .exe file. I copy code from MSDN about UpdateResource. But I can not update icon resource from a icon file.

    D 1 Reply Last reply
    0
    • X Xiaodi_Liu

      Now I can replace icon resource in a .exe file from other .exe file. I copy code from MSDN about UpdateResource. But I can not update icon resource from a icon file.

      D Offline
      D Offline
      David Crow
      wrote on last edited by
      #2

      In almost the same way. When copying from one EXE to another, you used LoadImage()/LoadResource() followed by LockResource() to get a pointer to the icon's data. You then called UpdateResource() with that pointer. When using an ICO file, the only difference is to use CreateFile() to open the ICO file, followed by ReadFile() to get a pointer to pass to UpdateResource(). Make sense?


      Five birds are sitting on a fence. Three of them decide to fly off. How many are left?

      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