I create my window using CreateWindowEx, but I only get an icon in the task bar; both the window’s title bar and the icon that shows when I Alt+Tab show this type of dummy icon:
. I set both the hIcon and the hIconSm fields in the WNDCLASSEX to the value returned from ::LoadIcon(hInstance, IDI_APPLICATION) (not NULL).
The .ico file itself was made out of a .png which I genereated through http://converticon.com to 16×16, 32×32 and 96×96 (what are the recommended sizes btw?). Could it be that I’m using the wrong sizes or color depth? If so, why does it work in the task bar (different size)? Thanks!
The icon must be defined as a resource somewhere. In your resource header there should be a line like this:
Then in your call to LoadIcon() it should be something like:
If you’re using Visual Studio it’s pretty easy to add resources. Just right click Resources in the solution explorer.