I was having a problem with Windows displaying the wrong icon for my app. I added both 32x32 and 16x16 icons to my icon resource. However, the 32x32 icon was being shown on the Taskbar window button, which looked ugly.
I looked in createWindowCallback in juce_win32_Windowing.cpp and found this line just before the call to RegisterClassEx:
Changing this to:
seemed to fix the problem nicely; now, the shell just extracts the correctly sized icon from the resource and everything’s peachy.
Any reason not to have it this way? I’ve only tried this with Windows XP.
That’s not much good if there’s only one icon though, or if they’re not in the same order.
I think the reason I added the ExtractIcon call was for DLLs rather than EXEs, because they’d pick up the host app’s icon by default instead of the DLL’s.