Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: Icon Image Questions  (Read 3292 times)

0 Members and 1 Guest are viewing this topic.

DaveLembke

    Topic Starter


    Sage
  • Thanked: 662
  • Certifications: List
  • Computer: Specs
  • Experience: Expert
  • OS: Windows 10
Icon Image Questions
« on: July 10, 2014, 01:05:50 PM »
While I know that there are software utilities out there to create your own icon images for applying to programs etc, I am not sure if there are any tools out there that allow for you to capture the icon image used to apply to a different file if that is even legal or not, for personal use and not for using it on something that is shared with others?

Or if there is a good web site out there that I can use that has free icon image's to apply to specific executable files to look through and download those images?

I downloaded a free application and it has what looks like a pile of colored books for its icon and thought that that icon would go well with an archive application I have instead of the boring default windows icon for executable that I am using, but not sure how I can copy that icon image to my program to give it that icon appearance.

BC_Programmer


    Mastermind
  • Typing is no substitute for thinking.
  • Thanked: 1140
    • Yes
    • Yes
    • BC-Programming.com
  • Certifications: List
  • Computer: Specs
  • Experience: Beginner
  • OS: Windows 11
Re: Icon Image Questions
« Reply #1 on: July 10, 2014, 02:37:53 PM »
Resource Hacker can do that.

Most Icon Editors can extract the icons from a dll,exe, or ocx file as well.

If you want to change the icon used for the program itself you'll likely need Resource Hacker though. Icon Programs that do allow changing of executables after editing icons will usually lose other information from the program's resource table.
I was trying to dereference Null Pointers before it was cool.

DaveLembke

    Topic Starter


    Sage
  • Thanked: 662
  • Certifications: List
  • Computer: Specs
  • Experience: Expert
  • OS: Windows 10
Re: Icon Image Questions
« Reply #2 on: July 10, 2014, 03:01:35 PM »
Quote
Most Icon Editors can extract the icons from a dll,exe, or ocx file as well

hmm didnt know this... any editors you can suggest with so many options out there?

Also regarding..

Quote
If you want to change the icon used for the program itself you'll likely need Resource Hacker though. Icon Programs that do allow changing of executables after editing icons will usually lose other information from the program's resource table.

Wasnt sure how the icons were bundled to the file. For all programs I have written, its always been whatever the default is. I figured people after they wrote their program compiled the program as an EXE and then used a icon utility to wrap icon image info to meta space of a file etc. This is a very grey area that I dont understand well and I am sure it shows in how I am wording all of this.  ;D   With other icons changed for programs and batch scripts etc, I generally used the ones available in the Windows\system32 location where there is a dll with a limited list of icon images to use such as a star or green arrow or a tree or CD ROM image or network image etc. Then applied one of those to the EXE or Batch file that I want to have that icon appearance on the desktop.

BC_Programmer


    Mastermind
  • Typing is no substitute for thinking.
  • Thanked: 1140
    • Yes
    • Yes
    • BC-Programming.com
  • Certifications: List
  • Computer: Specs
  • Experience: Beginner
  • OS: Windows 11
Re: Icon Image Questions
« Reply #3 on: July 10, 2014, 06:07:12 PM »
hmm didnt know this... any editors you can suggest with so many options out there?
I don't do much Icon Editing, Axialis Icon Workshop is what I use but it's not (usually :P) free. It definitely allows reading icons from executables. I believe IcoFX, another Icon Editor program, which is free, also is able to read icons from executables and files.

Quote
Wasnt sure how the icons were bundled to the file. For all programs I have written, its always been whatever the default is. I figured people after they wrote their program compiled the program as an EXE and then used a icon utility to wrap icon image info to meta space of a file etc. This is a very grey area that I dont understand well and I am sure it shows in how I am wording all of this.  ;D   With other icons changed for programs and batch scripts etc, I generally used the ones available in the Windows\system32 location where there is a dll with a limited list of icon images to use such as a star or green arrow or a tree or CD ROM image or network image etc. Then applied one of those to the EXE or Batch file that I want to have that icon appearance on the desktop.
Icons are part of the resources of a program. Typically compiled directly into the program. Most Development software let's you simply choose an icon and it get's compiled in. I've forgotten how it determines which icon to use for the Application icon (that is, what icon the program gets as a shortcut or in Windows Explorer). But I think it uses the first Icon resource in the file for that purpose.

The resources get compiled separately at a low level. if you have to use the base-level tools you would use RC.EXE, The Resource Compiler, and compile a Resource Script. This compiles into a .RES file that can be included as part of the build. Higher level (or, better) development tools typically just let you create a resource script and provide a UI environment to add, remove, edit, and change various resources (Strings, icons, etc). And then automatically includes the resources in the executable.

of course dll files are really the same format as executables, so they have their own resources. Windows includes a few resource-only dlls, one of which is specifically for icons, "moricons.dll".

To experiment and confirm what I mentioned above regarding the first icon being used as the application icon, you can rename moricons.dll to moricons.exe (of course, do this with a copy). And... boom! it changes to the MS-DOS icon. The .DLL icon is always the same because it is setup that way in the registry. (it points directly at a icon in shell32.dll) but .exe files are associated such that they use themselves as the source of their icon, and the extraction defaults to grabbing the first icon. It's even possible to make all executable programs show the second icon in their resources, though this makes everything look really stupid.

Resource Hacker is immensely useful, it only works for 32-bit programs and has been abandoned, but still serves a good usage. You can pretty much grab any data you want and even change it inplace. I "customized" Visual Basic 6 by editing vb6.exe using Resource Hacker and was able to edit the References dialog to be larger to use more of my screen space. I also embedded a Styles manifest, which is basically an XML file that get's embedded with a specific name that XP and later know about to check that a program "knows" about new styling stuff. XP and later check that to see if they should let a program use Themes. If the program doesn't have it is assumed it doesn't know and it doesn't get themed to make sure it doesn't break.



I was trying to dereference Null Pointers before it was cool.

DaveLembke

    Topic Starter


    Sage
  • Thanked: 662
  • Certifications: List
  • Computer: Specs
  • Experience: Expert
  • OS: Windows 10
Re: Icon Image Questions
« Reply #4 on: July 10, 2014, 06:57:56 PM »
Thanks BC for the info with details on how it all comes together etc.

When I get home from work tonight I am gonna see what I can do.  8)