flat assembler
Message board for the users of flat assembler.

Index > Windows > How to include multiple icons/resources

Author
Thread Post new topic Reply to topic
Gomer73



Joined: 29 Nov 2003
Posts: 151
Gomer73
Hi:

I looked at the minipad example and saw how to include one icon.
What is the format for including two or more icons?
Below is the minipad resource script:

section '.rsrc' resource data readable

; resource directory

directory RT_MENU,menus,\
RT_ICON,icons,\
RT_GROUP_ICON,group_icons,\
RT_VERSION,versions

; resource subdirectories

resource menus,\
37,LANG_ENGLISH+SUBLANG_DEFAULT,main_menu

resource icons,\
1,LANG_NEUTRAL,icon_data

resource group_icons,\
17,LANG_NEUTRAL,main_icon

resource versions,\
1,LANG_NEUTRAL,version_info

menu main_menu
menuitem '&File',0,MFR_POPUP
menuitem '&New',IDM_NEW,0
menuseparator
menuitem 'E&xit',IDM_EXIT,MFR_END
menuitem '&Help',0,MFR_POPUP + MFR_END
menuitem '&About...',IDM_ABOUT,MFR_END

icon main_icon,icon_data,'minipad.ico'

version version_info,VOS__WINDOWS32,VFT_APP,VFT2_UNKNOWN,LANG_ENGLISH+SUBLANG_DEFAULT,0,\
'FileDescription','MiniPad - example program',\
'LegalCopyright','No rights reserved.',\
'FileVersion','1.0',\
'ProductVersion','1.0',\
'OriginalFilename','MINIPAD.EXE'

So if I wanted to add an additional icon of minipad2.ico what would I need to do.

Thanks
Post 06 Dec 2003, 19:22
View user's profile Send private message Reply with quote
JohnFound



Joined: 16 Jun 2003
Posts: 3502
Location: Bulgaria
JohnFound
Code:
 resource icons,\
1,LANG_NEUTRAL,icon_data
2, LANG_NEUTRAL, icon_data2

resource group_icons,\
17,LANG_NEUTRAL,main_icon
18, LANG_NEUTRAL, second_icon

icon main_icon,icon_data,'minipad.ico'
icon second_icon, icon_data2, 'myicon.ico'
    


Of course you may use another label names and resource ID's.

BTW: The last pre-release version of FASM (Fresh) allow inserting directly RES files, so you can make RES file with some resource editor and then to use:

Code:
section '.rsrc' resource from 'myresource.res' data readable 
    


Regards.
Post 06 Dec 2003, 19:49
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
Gomer73



Joined: 29 Nov 2003
Posts: 151
Gomer73
That is awesome, thank-you.
It will be nice when we can insert the resource files, the old method doesn't work too well(using the offset of a dummy.exe file).
Post 06 Dec 2003, 21:50
View user's profile Send private message Reply with quote
GuyonAsm



Joined: 27 Sep 2003
Posts: 45
GuyonAsm
wow being able to insert the compiled resource file(.res) is so nice. Fasm is really making progress and in time will be one of the best out there =). Its free too damnit! *sniffle* I love you fasm.

_________________
I shall not evade what is predestined
because every battle, is another lesson
- GuyonAsm.

A Believer of The System.
Post 12 Dec 2003, 01:10
View user's profile Send private message Reply with quote
eet_1024



Joined: 22 Jul 2003
Posts: 59
eet_1024
Grab a copy of reshack and look at other executables. It's a great way to learn the structure of the resource section.
Post 12 Dec 2003, 05:24
View user's profile Send private message Reply with quote
Vortex



Joined: 17 Jun 2003
Posts: 318
Vortex
Gomer73,

I have an example on using external resource linker with Fasm.
Thanks to Privalov,now Fasm has a built-in resource linkerImage

http://board.flatassembler.net/topic.php?t=71

_________________
Code it... That's all...
Post 12 Dec 2003, 11:08
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.

Website powered by rwasa.