flat assembler
Message board for the users of flat assembler.

Index > Windows > How to understand resources ?

Thread Post new topic Reply to topic

Joined: 18 Aug 2005
Posts: 35
casey 18 Sep 2005, 02:43
Hi all,

My background: NASM using the NASMIDE IDE in DOS.

I am now up to Iczelion's Tutorial 8, Menu.

I am using Iczelion's tutorial along with Sulaiman
Chang's FASM versions of the examples.

What 'language' does a resource script use?

It appears different with MASM and FASM.

Is it the Assembler or the OS that reads this script?

I assume the LoadMenu API is how the menu resource
script is referenced to the program.

invoke LoadMenu, [wHInstance], 30 ; FASM

invoke LoadMenu, hInst, OFFSET MenuName ; MASM

Now in MASM, 'MenuName' is an address label to a
byte array, "FirstMenu",0

In the FASM version it is what?

I have found the 30 in the resource section:

resource appMenu, 30, LANG_ENGLISH, menuMain


menuitem 'MenuBar C (without item)', 30, MFR_END

which I take is an ID that is returned in the
wmCOMMAND's wParam when the item with that ID
is clicked.

Is there any easy way to understand all this?


John Casey

email: jgkjcasey@yahoo.com.au
Post 18 Sep 2005, 02:43
View user's profile Send private message Reply with quote

Joined: 25 Feb 2005
Posts: 1614
Location: Ukraine
shoorick 19 Sep 2005, 07:56
shortly and possible right in all detales Smile
language of resource script is separate language to define resources for executable (pe, ne?...): it is understandable to resource compilers: rc.exe, gorc.exe etc., wich can make from it .res file or .obj file. each resource has id and optional name. to support resources fasm has own set of macros to use them without rc compiler, or can create resource section directly from res file.
resource can be load with same function by id and by name: if passed value is less then 32768, it is treated as id, otherwise - as pointer to asciiz string with resource name:
invoke dialogboxparam,0,200,...
in rc:
200 DIALOGEX ...
#define DMAIN 200

invoke dialogboxparam,0,dmain
dmain db "DMAIN",0

in rc:
Post 19 Sep 2005, 07:56
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-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.