Solved

.RES format

Posted on 1998-01-31
3
916 Views
Last Modified: 2013-12-03
Can anybody give me the specification of the format of the resource files (.RES), or a URL to it?
I'm trying to code a freeware or GPL resource editor and this is a major problem for me for as long as it persists.
0
Comment
Question by:_Zaphod
  • 2
3 Comments
 
LVL 23

Accepted Solution

by:
chensu earned 40 total points
ID: 1410729
http://www.wotsit.demon.co.uk/binaries/res32.zip
http://www.wotsit.demon.co.uk/binaries/res.zip

And, the SDK documentation contains the following information.


Win32 Resource File Formats
This section describes the format of the binary resource file that the resource compiler creates based on the contents of the resource-definition file. This file usually has an .RES extension. The linker reformats the .RES file into a resource object file and then links it to the executable file of a Win32-based application.

A binary resource file consists of a number of concatenated resource entries. Each entry consists of a resource header and the data for that resource. A resource header is DWORD-aligned in the file and consists of the following:

· A DWORD that contains the size of the resource header

· A DWORD that contains the size of the resource data

· The resource type

· The resource name

· Additional resource information

The RESOURCEHEADER structure describes the format of this header. The data for the resource follows the resource header and is specific to each type of resource. Some resources also employ a resource-specific group header structure to provide information about a group of resources.

An accelerator table is one resource entry in a resource file. It does not have a group header. An AccelTableEntry structure describes each entry in the accelerator table. Multiple accelerator tables are permitted.

A dialog box is also one resource entry in the resource file. It consists of one DLGTEMPLATE dialog box header structure plus one DLGITEMTEMPLATE structure for each control in the dialog box. The DLGTEMPLATEEX and the DLGITEMTEMPLATEEX structures describe the format of extended dialog box resources.

Fonts are stored in the resource file as a group of resources. Individual fonts make up a font group. A FONT Statement resource definition statement in the .RC file defines each font. Each individual font in the resource consists of the complete contents of the related .FNT file. A FontGroupHdr structure follows all the individual font components in the .RES file.

Font resources are not added to the resources of a specific application. Instead, they are normally added to executable files that have a .FON extension. These files are usually resource-only dynamic-link libraries (DLLs) rather than applications.

Windows handles each icon and cursor as a single file. However, these are stored in .RES files and in executable files as a group of icon resources or a group of cursor resources. The file formats of icon and cursor resources are similar. In the .RES file a resource group header follows all of the individual icon or cursor group components.

The format of each icon component closely resembles the format of the .ICO file. Each icon image is stored in a BITMAPINFO structure followed by the color device-independent bitmap (DIB) bits of the icon’s XOR mask. The monochrome DIB bits of the icon’s AND mask follow the color DIB bits.

The format of each cursor component resembles the format of the .CUR file. Each cursor image is stored in a BITMAPINFO structure followed by the monochrome device-independent bitmap (DIB) bits of the cursor’s XOR mask, and then by the monochrome DIB bits of the cursor’s AND mask. Note that there is a difference in the bitmaps of the two resources: Unlike icons, cursor XOR masks do not have color DIB bits. Although the bitmaps of the cursor masks are monochrome and do not have DIB headers or color tables, the bits are still in DIB format with respect to alignment and direction. Another significant difference between cursors and icons is that cursors have a hotspot and icons do not.

The group header for both icon and cursor resources consists of a NEWHEADER structure plus one or more RESDIR structures. There is one RESDIR structure for each icon or cursor. The group header contains the information a Windows application needs to select the correct icon or cursor to display. Both the group header and the data that repeats for each icon or cursor in the group have a fixed length. This allows the application to randomly access the information.

A menu resource consists of a MenuHeader structure followed by one or more NormalMenuItem or PopupMenuItem structures, one for each menu item in the menu template. The MENUEX_TEMPLATE_HEADER and the MENUEX_TEMPLATE_ITEM structures describe the format of extended menu resources.

A message table is a resource that contains formatted text for display as an error message or in a message box. The main structure in a message table resource is the MESSAGE_RESOURCE_DATA structure.

The main structure in a version resource is the VS_FIXEDFILEINFO structure. Additional structures include the VarFileInfo structure to store language information data, and StringFileInfo for user-defined string information. All strings in a version resource are in Unicode format for Win32-based applications. Each block of information is aligned on a DWORD boundary.

For a group list of the structures that describe the format of resources, see Resource Structures.

0
 
LVL 1

Author Comment

by:_Zaphod
ID: 1410730
Dammit, I won't even check whether it's true before granting the points. It's gonna take me weeks! :)
0
 
LVL 23

Expert Comment

by:chensu
ID: 1410731
I have just found that MSDN Library (CDs or Microsoft Web site online version) also has the documentation. It is under
Specifications\Platforms\Win32 Binary Resource Formats.

Good Luck!
0

Featured Post

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Does Microsoft Office 2016 support COM/ActiveX? 3 127
What is Runtime?  What is Middleware?  Azure stack 1 520
Dir function fails on mapped drives 28 148
Visual Studio Debugging 3 151
zlib is a free compression library (a DLL) on which the popular gzip utility is built.  In this article, we'll see how to use the zlib functions to compress and decompress data in memory; that is, without needing to use a temporary file.  We'll be c…
For a while now I'v been searching for a circular progress control, much like the one you get when first starting your Silverlight application. I found a couple that were written in WPF and there were a few written in Silverlight, but all appeared o…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

713 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question