Re: Missing icon in Visual C++ Express 9
* campyhapper@yahoo.com:
Hi folks,
I'm using VC++ Express, which lacks a resource editor,
and as such I had to produce my own RC file in order
to add an icon to my application. In most respects
this has gone fine, however the icon is not being used
in all cases.
Basically it appears for the application's icon,
and the associated files have the icon, however
on the title bar of the running application there is
still the icon that is just a white box with a blue line
at the top.
The file icon is generally just the first icon in the file.
A window's icon, on the other hand, is set at run-time. Windows doesn't care
from what file the code that produced the window, came. You can set the icon at
two different levels: window class, and each individual window instance.
Some others here can inform you how to best set a window icon with MFC. Most
others here can't, but can give you cookbook recipes that "work".
Here is what's in my RC file:
1 ICON "icon.ico"
2 ICON "smallicon.ico
Icon 1 is 32x32 and icon 2 is 16x16. I added #2
because I hoped it would be used for the smaller
title bar (top left) icon, but it wasn't.
As some others have remarked, using separate icon resources is generally an
ungood way to provide different resolutions of an icon.
Instead provide them in the same icon resource.
Cheers, & hth.,
- Alf
--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?