user974967
user974967

Reputation: 2946

Win32: Changing Program Icon

I had originally decided that IDI_ICON1 would be a good fit for my program:

wndclass.hIcon         = LoadIcon (HINST_THISCOMPONENT, MAKEINTRESOURCE(IDI_ICON1));

The icon then appeared in the top left of the title menu for my main window and for the .exe file in Windows explorer.

I decided I liked IDI_ICON2 better, so I changed:

wndclass.hIcon         = LoadIcon (HINST_THISCOMPONENT, MAKEINTRESOURCE(IDI_ICON2));

Now icon2 appears in the top left of the title menu, but the icon in Windows explorer is still shown as icon1. What am I missing?

Upvotes: 4

Views: 7488

Answers (1)

K-ballo
K-ballo

Reputation: 81389

Explorer takes the first icon in your executable. That will be the one with the lowest id. Try managing your resources so that IDI_ICON2 is defined to be a lower integer than IDI_ICON1.

Upvotes: 7

Related Questions