GNAT and Windows Resources (GNAT User’s Guide for Native Platforms)

#### 7.4.8.20 GNAT and Windows Resources ¶

Resources are an easy way to add Windows-specific objects to your application. The objects that you can add as resources include:

- menus
- accelerators
- dialog boxes
- string tables
- bitmaps
- cursors
- icons
- fonts
- version information

You can use a version information resource to embed information into an executable or a DLL. This information can be viewed using the file properties from the Windows Explorer. Here’s an example of a version information resource:

>     1 VERSIONINFO
>     FILEVERSION     1,0,0,0
>     PRODUCTVERSION  1,0,0,0
>     BEGIN
>       BLOCK "StringFileInfo"
>       BEGIN
>         BLOCK "080904E4"
>         BEGIN
>           VALUE "CompanyName", "My Company Name"
>           VALUE "FileDescription", "My application"
>           VALUE "FileVersion", "1.0"
>           VALUE "InternalName", "my_app"
>           VALUE "LegalCopyright", "My Name"
>           VALUE "OriginalFilename", "my_app.exe"
>           VALUE "ProductName", "My App"
>           VALUE "ProductVersion", "1.0"
>         END
>       END

>       BLOCK "VarFileInfo"
>       BEGIN
>         VALUE "Translation", 0x809, 1252
>       END
>     END

The value `0809` (langID) is for the U.K English language and `04E4` (charsetID), which is equal to `1252` decimal, for multilingual.

This section explains how to build, compile and use resources. Note that this section does not cover all resource objects; for a complete description see the corresponding Microsoft documentation.