Export (0) Print
Expand All

Windows Resource Files

You should place every element of the user interface that needs to be localized in a Windows resource file, including pictures, strings, messages, menus, dialog boxes, and version information. The table below lists the individual resource elements defined by Windows.

Individual Resource Files Defined by Windows

Resource Type Element File Format Comment/ Description
RT_CURSOR Cursor .CUR #include in .RC file
RT_BITMAP Bitmap or toolbar .BMP #include in .RC file
RT_ICON Icon .ICO #include in .RC file
RT_MENU Menu or pop up menu .RC #include in .RC file
RT_DIALOG Dialog .DLG or .RC #include .DLG file in .RC file
       
RT_STRING String .RC  
RT_FONTDIR Font .FNT  
RT_FONT Font .FNT  
RT_ACCELERATORS Accelerator .RC  
RT_RCDATA User-defined resource .RC Can use for constants or application specific structures
       
RT_MESSAGETABLE Messages .MC #include compiled message table in .RC file
       
RT_GROUP_CURSOR Cursor N/A Generated internally by resource compiler to provide Windows with information about cursor's resolution and type
       
RT_GROUP_ICON Icon N/A Generated internally by resource compiler to provide Windows with information about icon's resolution and type
       
RT_VERSION Version information .RC  
       
RT_DLGINCLUDE Header file that contains menu and dialog box #define statements .RC Used by resource editing tools; Visual C++ uses its own mechanism tools;


As you can see in Figure 4-4 below, Visual C++ 2 presents you with a categorized list of all elements contained in your resource file. To add a menu, string, or other item, click on the appropriate category, create a new identifier, and assign it a value and type. The tool automatically fills in the rest of the resource file format. To see what the complete resource file format looks like, open your .RC file in a simple text editor.

Figure 4-4. Visual C++'s resource editing environment.

Show:
© 2014 Microsoft