Resources and the Icon Demo Program

I am currently studying the use of resources in programs. However, I have a question about Petzold's "Icon Demo" program. Has anyone worked with it.

The program runs as it should---the icon is displayed in the upper-left corner of my window. However, in the taskbar, I am getting some totally random system icon. The taskbar should be displaying my custom icon. Has anyone else encountered this? Is there something missing from my program?
The Win32 API has changed since Win98 days. Someone has taken the time to convert and update much of Petzold's 5th Edition C code to modern Win32. Chapter 10 is one of the updated chapters.
https://github.com/recombinant/petzold-pw5e

What is your OS and compiler? Using Visual Studio 2019 (or 2017) with Win10 and the updated source the icon displays as expected in the client area, the window system icon and on the taskbar. Win10 is downright picky about icons.
Hey Furry Guy. I get the same result that you described, using Win7 and VS 2019. So, that is normal behavior, and I didn't forget anything. I wonder if it has to do with the fact, that I'm running the program through the compiler. Would the correct icon display in the taskbar, if I ran the .exe file as stand-alone? Not that I'm going to bother. I'm just curious.
When I use VS2017/2019 I usually launch the app via the IDE. Launching via a shortcut or the executable directly shouldn't make a bit of difference.

More often than not when having issues with Windows restarting/rebooting fixes the problem. No matter what the Winver.

Petzold's 5th Edition is still a good if outdated Win32 Desktop API reference. There are some things the accompanying source code has problems doing since the Win32 API has changed. In some areas significantly.

A biggie is no longer having to redraw the window, or any portion, when obscured by another window and later uncovered. The Vista (and later) Desktop Window Manager handles redrawing by using a "offscreen buffer" system for desktop composition.
https://docs.microsoft.com/en-us/windows/win32/dwm/dwm-overview

The DWM is an example of double-buffering. In this case done for you without any intervention on your part.
Topic archived. No new replies allowed.