flat assembler
Message board for the users of flat assembler.
Index
> Windows > directly use a group icon? |
Author |
|
JohnFound 07 Aug 2011, 08:52
No, it is not possible. Actually the easiest way to make it is to use .res file, created with some resource editor/compiler and then to create directly the resource section with:
Code: section '.res' resource readable from 'yourresources.res' I prefer to use ResHacker. |
|||
07 Aug 2011, 08:52 |
|
yoshimitsu 07 Aug 2011, 11:01
but then it wouldn't be possible to use fasm's resource-facilities in combination because of the resource directory with which the resource data starts, would it?
|
|||
07 Aug 2011, 11:01 |
|
JohnFound 07 Aug 2011, 11:07
Yes, in this case you have to compose all needed resources in the .res file.
|
|||
07 Aug 2011, 11:07 |
|
Tomasz Grysztar 10 Aug 2011, 14:17
Yes, the macro currently is not able to load multiple icons from one .ico file, but you can still create the icon group by using multiple .ico files.
documentation wrote: The are two resource types related to icons, the RT_GROUP_ICON is the type for the resource, which has to be linked to one or more resources of RT_ICON type, each one containing single image. This allows to declare images of different sizes and color depths under the common resource identifier. This identifier, given to the resource of RT_GROUP_ICON type may be then passed to the LoadIcon function, and it will choose the image of suitable dimensions from the group. To define the icon, use the icon macroinstruction, with first parameter being the label of RT_GROUP_ICON resource, followed by the pairs of parameters declaring the images. First parameter in each pair should be the label of RT_ICON resource, and the second one the quoted string containing the path to the icon file. Source: Resource macros documentation And I think the macro could be easily extended to allow index of icon in file after the file name (like 'my.ico':0 in place of current 'my.ico'), but there is no such feature implemented there for now. |
|||
10 Aug 2011, 14:17 |
|
bitshifter 10 Aug 2011, 17:32
This macro came from somewhere on this forum.
I dont know where from or who the author was? Code: macro multi_icon group,[label,icon_file,num] { common local count count = 0 forward local data,size,position label dd RVA data,size,0,0 virtual at 0 file icon_file:6+(num*16),16 load size dword from 8 load position dword from 12 end virtual data file icon_file:position,size count = count+1 common local header align 4 group dd RVA header,6+count*14,0,0 header dw 0,1,count forward file icon_file:6+(num*16),12 dw label#.resid common align 4 } directory RT_ICON,dir_icons,\ RT_GROUP_ICON,dir_group_icons resource dir_icons,\ 1,LANG_NEUTRAL,icon_data1,\ 2,LANG_NEUTRAL,icon_data2 resource dir_group_icons,\ IDR_MAINICON,LANG_NEUTRAL,res_icon_main multi_icon res_icon_main,\ icon_data1,'MYICON.ICO',0,\ icon_data2,'MYICON.ICO',1 |
|||
10 Aug 2011, 17:32 |
|
Alphonso 10 Aug 2011, 18:19
bitshifter wrote: This macro came from somewhere on this forum. http://board.flatassembler.net/topic.php?t=6817 |
|||
10 Aug 2011, 18:19 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.