Cocos2d-x change icon Win32

Hey there,

I’m building a cocos2d-x project on Win32. I would like to change the icon on executable from default cocos2d icon to my own icon. I tried:

  • Overwriting icon under proj.win32\res\game.ico
  • Changing location under proj.win32\game.rc to reference my icon file.

No luck with any of the above, still getting same icon. I am using cocos2d-x version 4.
Any suggestions on what I need to do?

Thanks in advance.

I bet @dogwalker knows :slight_smile:

Great question! I need to find my notes, it’s been a while. But I have a game.ico file right inside my proj.win32 folder and also have a game.rc file. However, I also have the game.ico file inside proj.win32/res. I seem to recall doing something in Visual Studio the first time I created an icon.

I can share the whole game.rc file, but you probably already have one. Just check on this section:

// Icon
// Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems.
GLFW_ICON ICON “res\game.ico”

I do remember that I had to clear my windows cache or the new icon wouldn’t even show up. Check this:

I’ll try to provide more information tomorrow.

1 Like

All I did was to change the ico in this folder: proj.win32/res


Both of these answer make up the solution to this question. Nice work everyone helping a fellow developer.

Brilliant! Thanks so much. I was being bitten by the icon cache. Refreshing it did the trick.