flat assembler
Message board for the users of flat assembler.
 Home   FAQ   Search   Register 
 Profile   Log in to check your private messages   Log in 
flat assembler > Windows > EXE file icon

Author
Thread Post new topic Reply to topic
Constantine



Joined: 29 Oct 2016
Posts: 7
EXE file icon
I need to create icon of my exe file. I wrote resources section as specified in docs:


Code:

section '.rsrc' resource data readable
  directory RT_ICONiconsRT_GROUP_ICONgroup_icons
  resource icons1LANG_NEUTRALicon_data
  resource group_icons2LANG_NEUTRALmain_icon
  icon main_iconicon_data'file.ico'




file.ico contains 10 icons of various sizes and bit depths. But resulting exe file got only one icon: 32x32x4. What should I change to get full range of icons in executable?
Post 29 Oct 2016, 07:33
View user's profile Send private message Send e-mail Reply with quote
ProMiNick



Joined: 24 Mar 2012
Posts: 22
Location: Russian Federation, Sochi
smsng like that (there bugs inside it is only idea)

Code:

macro multyicon group,[label,icon_file; usage multyicon instead of icon:  multyicon main_icon,<icon_data1_at_fileico,icon_data2_at_fileico,...>,'file.ico'
 { common local count
    count = 0
   forward ;local lcount
      irpv lbl,label \{
        local data,size,position
        lbl dd RVA data,size,0,0
        ;virtual at 0
        ;  file icon_file:4,2
        ;  load lcount word from 0
        ;end virtual
        ;% must be <=lcount
        virtual at 0
        file icon_file:6+16*(%-1),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
     irpv lbl,label \{
       file icon_file:6+16*(%-1),12
       dw lbl#.resid
     \}
   common
    align 4 } 




And of course you can split 1 ico file to 10 by sm progs like microangelo and use standard macro.

Thou ever can split ico with fasm:



Code:

; must be compiled as many times as subicons file has
; source icon should be in other folder than code or it will be overriden
; source code each time should be renamed or each previous ico will be overriden
format binary as 'ico'
macro extractico icon_file,num
{
  virtual at 0
  file icon_file:4,2
  load count word from 0
  if count<num
    err 'Индекс иконки превысил количество'
  end if
  end virtual
  file icon_file,4
  dw 1
  file icon_file:6+num*16,16
  load size dword from $-8
  load offset dword from $-4
  file icon_file:offset,size
}
extractico 'file.ico',1 ; change that from 1 to ico count in file 




Thou can think how to implement 1st case, or use 2nd and don`t think.

_________________
I don`t like to refer by "you" to one person.
My soul requires acronim "thou" instead.
Post 29 Oct 2016, 23:25
View user's profile Send private message Send e-mail 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


Powered by phpBB © 2001-2005 phpBB Group.

Main index   Download   Documentation   Examples   Message board
Copyright © 2004-2016, Tomasz Grysztar.