Visual Studio let us import an icon into the resource and when building it the icon will be used for the program's icon (the actual executable icon) but in order to set the icon on the window title bar (left side) and for when we do alt-tab, we need to set it at runtime.
I didn't find a way to set the icon with sfml with icon being in the resources (not loading an external .ico or .png file).
So I've done this for windows:
#ifdef WIN32
HICON hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_ICON1));
if(hIcon)
{
SendMessage(windowgetSystemHandle(), WM_SETICON, ICON_BIG, (LPARAM)hIcon);
}
#endif
Is there a way to do this with SFML? I don't know if it can be done with Linux, I could add a #else and do it for Linux but I'd rather not if SFML can or will do it.
Any word?
Thanks!