开发者

Unwanted Extra Icons in Application

Using Delphi 2007. I am adding 2 extra icons to my app to use for some custom file associations. Using custom resource files and开发者_如何学Go that is working correctly. However when looking at the resultant exe files I found some extra icons and I do not know where they coming from.

The result is my icons are becoming icons 5 and 6 instead of 1 and 2. Result is that when adding the custom file associations my DefaultIcon registry entry must use 5 and 6 instead of what I expected.

My concern is that since I don't understand where those icons are coming from I may cause myself problems in the future.

Any ideas where to look for them?


Delphi adds a single icon to your exe (default or user specified).

If you are seeing more icons in your application, then they are either:

  • Being added with a .rc file somewhere.
  • They have been added directly to your project's .res file.

You can look at and edit the contents of your .res file using any resource editor. Two good examples are applications from Anders Melander and Colin Wilson.

UPDATE:

Since Luke didn't find another .rc file and his .res file is correct, here are a couple of other things I would try:

  • Delphi 2007 supports pre and post build events. See if there are any that might add resources.
  • Look at the compiler output in the Messages window for any signs of an unexpected .res or .rc file.
  • Search your source files for instances of ".res" or ".rc".


To add to what Bruce said, ResHacker is also a free tool to view the resources of your exe.

Also, Im not sure if this would work but could you store the icons you want in a resource dll, and extract/use them when you need to?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜