flat assembler
Message board for the users of flat assembler.

Index > Windows > Icon resources?

Author
Thread Post new topic Reply to topic
rohagymeg



Joined: 19 Aug 2011
Posts: 77
rohagymeg 29 Aug 2011, 15:25
Since my last post didn't get an answer, I started a new thread.

Can I call an icon which is in a .res file to for example display the icon on the tray?
Or must I use the fasm icon macros? This resource thing is killing my brain! I thought it would be a simple task to implement a program icon, but I was wrong.

ps.:I'm getting frustrated because I have more questions than answers. I decided to make a new post for every question. I believe there are some newbies like me and they probably has the same questions like me. So the help is very much appreciated!
Thank you!
Post 29 Aug 2011, 15:25
View user's profile Send private message Reply with quote
Enko



Joined: 03 Apr 2007
Posts: 676
Location: Mar del Plata
Enko 29 Aug 2011, 15:45
Yes you can use an icon resource:

Quote:

section '.rsrc' data readable resource from 'my.res'


where my.res have the icon resources with a valid ID.

Then use LoadIcon(hInstance, INT_RESOURCE_ID)
Post 29 Aug 2011, 15:45
View user's profile Send private message Reply with quote
rohagymeg



Joined: 19 Aug 2011
Posts: 77
rohagymeg 29 Aug 2011, 15:54
Ok, I'll try that. But which program should I use? I used resedit, but I didn't see any id there and I didn't know how to give an id number to the icons. So how should I make a res file and does it matter what id number I give to them? 401 or 333, does it have a rule?
Post 29 Aug 2011, 15:54
View user's profile Send private message Reply with quote
Enko



Joined: 03 Apr 2007
Posts: 676
Location: Mar del Plata
Enko 29 Aug 2011, 17:04
RightButton on the added icon resource >> Rename >> Ordinal Identifier >> Wirte a Number.

There is no rule for resources, but mostly for your benefit, the name is somehow sequential.

501 icon1
502 icon2
503 icon4

400 dlg1
401 dlg2


Or any other number you like.


I had some problems with programs like ResEdit, ResEd, nx resource editor, etc...

most of the time, I prefer to use them to made a scratch of the resource, than finally edit it manually and compile the resource using RC.EXE (Microsoft resource compiler which comes with masm32 it will requeire windows.h to understand the constants)
Post 29 Aug 2011, 17:04
View user's profile Send private message 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-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.