Change Icon of EXE file through code extracting it from other EXE file

Discussion in 'MFC' started by shabbir, Mar 18, 2006.

  1. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,375
    Likes Received:
    388
    Trophy Points:
    83
    What is not working for you
     
  2. VijayLaxmi

    VijayLaxmi New Member

    Joined:
    Feb 16, 2010
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    0
    Icon not replaced on EXE file.
     
  3. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,375
    Likes Received:
    388
    Trophy Points:
    83
    Did you try the exact steps I mentioned because I downloaded the samples and saw that its working.

    Also remember that you have more than one icon in many executable's and you may need to change each of them
     
  4. VijayLaxmi

    VijayLaxmi New Member

    Joined:
    Feb 16, 2010
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    0
    Yes i use the sample exactly.actually i m working on Vista i dont think its generate any issue.
    please help me for this.
    thanks.
     
  5. PyroStrex

    PyroStrex New Member

    Joined:
    Mar 22, 2010
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    Well, sorry if what i will be asking is not suite for this topic but how about String table? Can you give me some hint? Sorry again.
     
  6. abcdark

    abcdark New Member

    Joined:
    Feb 12, 2012
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    I didnt use the sample code. I copied the function onbuttonchangeicon() and modified the variables and used it in a console program. It succesfully changes icons for certain executables but not all. Anyways, the problem that bugs me is that if you copy the exe file to another location then the new icon is not visible. The old icon comes back. and if u again copy back the file into the original folder where it was initially, then it again regains the icon. So icon is not "locked" to the exe. Wht to do ??
     
  7. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,375
    Likes Received:
    388
    Trophy Points:
    83
    There are multiple size icons in an exe and the code changes only one and so when you copy, you may be seeing different icon size. It is locked into the exe and you can verify that with Resource Hacker as well
     
  8. bit8bug

    bit8bug New Member

    Joined:
    Feb 24, 2013
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    Hi shabbir
    I downloaded the source code , in the file ExeUpdatesDlg line 227 why you are looping the destination exe ?
    I followed your tutorial but the icons are getting corrupted
    I have the code attached :crazy:
    GetLastError() is always returning zero - NO ERRORS -
     

    Attached Files:

    • tmp.txt
      File size:
      1.1 KB
      Views:
      618
  9. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,375
    Likes Received:
    388
    Trophy Points:
    83
    The looping is because you can have multiple icons in the executable.
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice