Resource file

Can anybody tell me the excact format of the resource file Delphi 2.0 uses?
djernaesAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

ozzyCommented:
I'm not sure what you exactly mean.  However, if you go to 'Tools' and run image editor, then you can load, create, or delete a resource file from there.  Select file-New Resource File, or Icon, or Image.  You can add icons to one, or add bitmaps from there.

0
djernaesAuthor Commented:
I mean the format ogf the .RES file, which is included in your Delphi programs.

I know it is a header + resource entry's, but how do I code/decode the file to bitmaps, icons, strings, rc_data... etc.?
0
djernaesAuthor Commented:
When asking for a format of a file, I do not expect to be told how to start a program which can read the file.

Martin
0
Become a Microsoft Certified Solutions Expert

This course teaches how to install and configure Windows Server 2012 R2.  It is the first step on your path to becoming a Microsoft Certified Solutions Expert (MCSE).

GaborCommented:
There is a utility called Convert.exe.If you use it on a .dfm file, you get a readable .txt file.The .dfm files are stored as resources, and you can access them as by its name.All other resources are the same as in any other windows application.
0
djernaesAuthor Commented:
Sorry,

Header? Format? Body? etc

Martin
0
GaborCommented:
I tried to help you, not to get your points. I think you can figure it out if you see it's contents. I can see it for you, but it's worth more than 100 points.Gabor
0
djernaesAuthor Commented:
? Sorry Gabor,

I have increased the amount of points - What do you want for the answer to the question?

Martin
0
djernaesAuthor Commented:
? Sorry Gabor,

I have increased the amount of points - What do you want for the answer to the question?

Martin
0
gfk081397Commented:
I understand you are really interested in the format. It might however help you to have a look at the TResourceStream class if you haven't done so ages ago. It gives access to all resources in a EXE or DLL file.

The Res file format and the corresponding Res sections in Exe's/Dll's are of course Microsoft's tech.

Try ftp.microsoft.com\SOFTLIB\MSLFILES\EXEVIEW.EXE. (c-source code for the "old" Win3.x format) if it is still there.

Microsoft Press have books on the RESOURCE format. It is extensive.....
0
ZifNabCommented:
This isn't much, but it can help.

Look at this site : http://www.wotsit.demon.co.uk/

It's a file format collection site. I don't believe that they have the format of RESOURCE file but if it isn't urgent you can ask them. You can give a request there and maybe they help you with it.
I believe I've once saw it in a book myself, but that's a long time ago. But I'll run over the books I've got. If I find something I'll let you know.

Well, good luck, hope you are something with this, I thought I could help you this way.
0
ZifNabCommented:
Well, look at the BMP format on this site http://www.wotsit.demon.co.uk, it's a text-file with formats of resource files. It's a little bit too big, otherwise I had posted it here.

Hope you're something with it.

Have fun,
c.u. ZifNab
0
djernaesAuthor Commented:
Thanks
0
ZifNabCommented:
Found what you were looking for?

Have fun,
c.u. BanZif;
0
djernaesAuthor Commented:
Looks like, thangs again :-)
0
ZifNabCommented:
Hi djernaes,

Why didn't you deleted this question? Haven't got the answer yet?
Maybe this is :

By Ray Lischner, Tempest Software

A Windows resource file (.RES) contains a series of packed resource entries, with no other structure, that is no headers, footers, padding, etc. The format of a resource entry is different for Windows 3.x (16-bit) and Win32, that is, Windows 95 and Windows NT (32-bit).

32-bit

A 32-bit .RES file starts with an empty resource entry of 32 bytes:

00000000 20000000 FFFF0000 FFFF0000 00000000 00000000 00000000 00000000

After that comes the real resource entries, packed into the file with no padding or other structure--just a series of resource entries.

Each resource entry has a header followed immediately by the resource data. Immediately after the data for one entry comes the header for the next entry. Each header has the following format:

Field/Size (bytes)/ Description

Data Size/4/Size of the resource data that follow the header
Header Size/4/Size of the resource header (always at least 16)
Type/variable/{Resource type }
Name/variable/Resource name or identifier
Data Version/4/Version number for resource data format, usually 0
Flags/2/Most flags are for backward compability with Win16. Discardable (100016) is the only Win32 flag.
Language/2/Primary and secondary language identifiers. Zero for language-neutral, or look up your Windows documentation for a full list of identifiers. Form a language identifier from a primary and sublanguage as follows: (sublanguage << 10 | primary).
Version/4/Version number for the resource entry
Characteristics/4/Anything you want

The type and name can be numeric or textual. If the first two bytes are FFFF16, the subsequent two bytes are the numeric value. Otherwise, the first two bytes are the first Unicode character in a zero-terminated string.

16-bit

Each resource entry has a header followed immediately by the resource data. Immediately after the data for one entry comes the header for the next entry. Each header has the following format:

Field/Size/Description

Type/variable/Resource type
Name/variable/Resource name or identifier
Flags/2/Discardable=100016, Moveable=001016, Pure=002016, Preload=004016
Size/4/Size of the resource data that immediately follow the header

The type and name can be numeric or textual. If the first byte is FF16, the subsequent two bytes are the numeric value. Otherwise, the first byte is the first character of the ANSI string.

Resource types

Windows reserves numeric resource types under 256 for its own use. In this range are several predefined resource types:

Type/Value/Description

RT_CURSOR/1/Cursor image (one entry in a cursor group)
RT_BITMAP/2/Bitmap (Windows or OS/2 BMP format)
RT_ICON/3/Icon image (one entry in an icon group)
RT_MENU/4/Menu
RT_DIALOG/5/Dialog box
RT_STRING/6/String table (must have numeric identifier, not textual)
RT_FONTDIR/7/Font directory
RT_FONT/8/Font entry
RT_ACCELERATOR/9/Keyboard accelerator table
RT_RCDATA/10/Application-defined data
RT_GROUP_CURSOR/12/Group header for a cursor
RT_GROUP_ICON/14/Group header for an icon

Win32 defines additional resource types:

Type/Value/Description

RT_MESSAGETABLE/11/Message table
RT_VERSION/16/Version information
RT_DLGINCLUDE/17/Dialog include
RT_PLUGPLAY/19/Plug and play
RT_VXD/20/VxD
RT_ANICURSOR/21/Animated cursor

If you want an htm version of this text, I can send it to you.
You can also get it from the Wotsit's file format collection site. It came from there.

Have fun,
c.u. ZifNab;

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
djernaesAuthor Commented:
I can not delete a question (or how do I delete a question)

I have got an answer as you can se from the comments, so I don't quite know if it's fair giving you the points !

Martin
0
ZifNabCommented:
Hi djernaes,

Don't need the points, just wanted to help you,
because I thought you still hadn't a clear solution. I already gave you a comment (BMP format, see above) and I thought that this was a solution (not so clear solution) for you. But now I founded a clear format about the RES-files. So to be sure you read this comment I made an answer of it.
Don't care if you reject this, i'm glad you found a solution.

Have fun,
c.u. ZifNab;

0
djernaesAuthor Commented:
Hi ZifNab,

First sorry if my comment offended you, that was not my intension. I just have the idea at the person who actually gave me the information ourght to get the points :) What I didn't see (and not looked after) was that the one actually were you.

Thanks for the ekstra comments about the fileformat, I'll store it for later use, while I don't have time using at the moment (but that have to come later).

Regards & thanks
  Martin
0
ZifNabCommented:
No problem, glad I could help you.
And I'm more hapier knowing I've helped someone than earning points for it, but 10x for the points.

c.u.
ZifNab
0
djernaesAuthor Commented:
Hi ZiNab,

You are welcome - my pleasure.

Martin
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Delphi

From novice to tech pro — start learning today.