Not sure, and I guess this is more a WIN32 question than a fltk one.
Your icon code looks a bit different from mine - I wrote the code I use a *long* time ago and don't really remember what all the bits do now; I just cut and paste it between apps and it Just Works...
Anyway, what I do first is create an icon with multiple sizes in it; that seems to make Windows happier, I find.
Then, before the window is shown (for fltk windows) I do:
// Set icon for window before we show it (MacOS uses app bundle for icon...)
#ifdef WIN32
main_window->icon((char *)LoadIcon(fl_display, MAKEINTRESOURCE(IDI_ICON)));
#endif // WIN32
main_window->show();
Then, once the window is shown, I add some extra icon sizes...
#ifdef WIN32
// The fltk icon code above only loads the default icon.
// Here, once the window is shown, we can assign
// additional icons, just to make things a bit nicer.
{
HANDLE bigicon = LoadImage(GetModuleHandle(0), MAKEINTRESOURCE(IDI_ICON), IMAGE_ICON, 32, 32, 0);
SendMessage(fl_xid(main_window), WM_SETICON, ICON_BIG, (LPARAM)bigicon);
HANDLE smallicon = LoadImage(GetModuleHandle(0), MAKEINTRESOURCE(IDI_ICON), IMAGE_ICON, 16, 16, 0);
SendMessage(fl_xid(main_window), WM_SETICON, ICON_SMALL, (LPARAM)smallicon);
}
#endif // !WIN32
I note that I am using LoadImage to get the icon images form the resource, and then sending those to the window; that seems to differ from what you are doing - might be worth a try, at any rate!
Hope that helps...
Selex ES Ltd
Registered Office: Sigma House, Christopher Martin Road, Basildon, Essex SS14 3EL
A company registered in England & Wales. Company no. 02426132
********************************************************************
This email and any attachments are confidential to the intended
recipient and may also be privileged. If you are not the intended
recipient please delete it from your system and notify the sender.
You should not copy it or use it for any purpose nor disclose or
distribute its contents to any other person.
********************************************************************