How to update Icon for exe (MAINICON)?

youki 956 Reputation points

I added an icon for the exe by adding the ico to the resources and MAINICON in code of myProject.rc, after compiling and using "Start Without Debugging", the icon appeared:

I can't update the icon. When i add another icon and execute the same steps, it always has the old icon. How can i update it easily?

Windows API - Win32
Windows API - Win32
A core set of Windows application programming interfaces (APIs) for desktop and server applications. Previously known as Win32 API.
2,222 questions
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,175 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. David Lowndes 965 Reputation points MVP

    As a sanity check open your EXE in Visual Studio and make sure the new icon resource has replaced the prior one.
    Assuming it has, you're probably seeing the old icon in Explorer due to the Windows icon cache - see here.

    1 person found this answer helpful.
    0 comments No comments

  2. youki 956 Reputation points

    Ty @David Lowndes , it helped with the icon of the exe file.

    I also had to clear the cache of the system tray to update the BalloonTip icon on the title bar, it also takes the MAINICON.

    0 comments No comments