News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

How Do You Add An Icon?

Started by The Rogue, July 19, 2008, 11:28:08 PM

Previous topic - Next topic

The Rogue

How would I add an icon to a MASM project? Someone said something about resource script files? Can anyone point me in the right direction?

Thanks.

hutch--

Rogue,

Create the icon then use a resource editor to add it into the project. hen you use the Windows API LoadIcon() or LoadImage() to get a working handle to it and display in where you need.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

The Rogue

I dont want to display the icon. I want it to be for the exe itself.

PBrennick

Rogue,
Just load it using the resource script. You do not need to add any instructions in the assembly source file if that is all you want to do. When the project is built, the exe will use the icon, on the desktop, for example. I have included an example from the GeneSys Project to show you how it is done.

[attachment deleted by admin]
The GeneSys Project is available from:
The Repository or My crappy website

Tedd

Simply add the icon as a resource.
Windows will display the 'first' icon as the exe's icon - so make sure it's numerically first (or alphabetically, if you're using string names); not that it matters if you only have one icon :wink

In your .rc file, add the following line:
100 ICON "youricon.ico"
No snowflake in an avalanche feels responsible.

jj2007

Quote from: Tedd on July 20, 2008, 05:03:14 PM
Simply add the icon as a resource.
Windows will display the 'first' icon as the exe's icon

Just for curiosity: Is there any way to tell Windows it should use the icon of another file, i.e. not to embed an icon, but rather put a reference only? This works obviously for shortcuts and for registered application files, e.g. the .pdf and .doc show their respective icons.

Jimg

opps, replied in wrong topic, please delete.