I'm working on a project with wxWidgets (the 2.9 branch). I'm using gcc and makefiles - most of the questions I've found on this deal with Visual Studio.
The problem is, I've created an icon with IcoFX, and it includes several different sizes of icon, including the 16x16 icons that should show up in the corner of the window. The icon does show up in the Windows 7 task bar, but not in the corner of the window or in the Alt+Tab menu.
My resource file looks like this:
#include "wx/msw/wx.rc"
1 ICON "images/icon-win.ico"
No matter what I put as the icon's identifier (tried 1, 0, strings, wx***) it doesn't change anything.
I am using windres to compile the resource file to COFF format, which is then linked in with the final executable.
I've also tried wxFrame::SetIcon, which hasn't worked either.
Is there a trick to setting the window's icon? I've seen a couple ways to do it that involve the Windows API, but I'd rather not go there if I don't have to. I thought it was supposed to show up automatically when you put it in the resources file.
Add this line to your resource file:
frame_icon ICON "images/icon-win.ico"
Add this line to your frame constructor
SetIcon(wxICON(frame_icon));