Resource-Definition Statements

The resource-definition statements define the resources that the resource compiler puts in the resource (.Res) file. After the .Res file is linked to the executable file, the application can load its resources at run time as needed. All resource statements associate an identifying name or number with a given resource.

The resource-definition statements can be divided into the following categories:

  • Resources
  • Controls
  • Statements

The following tables describe the resource-definition statements.

Resources

Resource Description
ACCELERATORS Defines menu accelerator keys.
BITMAP Defines a bitmap by naming it and specifying the name of the file that contains it. (To use a particular bitmap, the application requests it by name.)
CURSOR Defines a cursor or animated cursor by naming it and specifying the name of the file that contains it. (To use a particular cursor, the application requests it by name.)
DIALOG Defines a template that an application can use to create dialog boxes.
DIALOGEX Defines a template that an application can use to create dialog boxes.
FONT Specifies the name of a file that contains a font.
HTML Specifies an HTML file.
ICON Defines an icon or animated icon by naming it and specifying the name of the file that contains it. (To use a particular icon, the application requests it by name.)
MENU Defines the appearance and function of a menu.
MENUEX Defines the appearance and function of a menu.
MESSAGETABLE Defines a message table by naming it and specifying the name of the file that contains it. The file is a binary resource file generated by the message compiler.
POPUP Defines a menu item that can contain menu items and submenus.
PLUGPLAY Obsolete.
RCDATA Defines data resources. Data resources let you include binary data in the executable file.
STRINGTABLE Defines string resources. String resources are Unicode or ASCII strings that can be loaded from the executable file.
TEXTINCLUDE A special resource that is interpreted by Visual C++. For more information, see TN035.
TYPELIB A special resource that is used with the /TLBID and /TLBOUT linker options.
User-Defined Defines a resource that contains application-specific data.
VERSIONINFO Defines a version-information resource. Contains information such as the version number, intended operating system, and so on.
VXD Obsolete.

 

For more information about predefined MFC resources, see TN023 and TN024.

Controls

Control Description
AUTO3STATE Creates an automatic three-state check box control.
AUTOCHECKBOX Creates an automatic check box control.
AUTORADIOBUTTON Creates an automatic radio button control.
CHECKBOX Creates a check box control.
COMBOBOX Creates a combo box control.
CONTROL Creates an application-defined control.
CTEXT Creates a centered-text control.
DEFPUSHBUTTON Creates a default pushbutton control.
EDITTEXT Creates an edit control.
GROUPBOX Creates a group box control.
ICON Creates an icon control. This control is an icon displayed in a dialog box.
LISTBOX Creates a list box control.
LTEXT Creates a left-aligned text control.
PUSHBOX Creates a push box control.
PUSHBUTTON Creates a push button control.
RADIOBUTTON Creates a radio button control.
RTEXT Creates a right-aligned control.
SCROLLBAR Creates a scroll bar control.
STATE3 Creates a three-state check box control.

 

Statements

Statement Description
CAPTION Sets the title for a dialog box.
CHARACTERISTICS Specifies information about a resource that can be used by tool that can read or write resource-definition files.
CLASS Sets the class of the dialog box.
EXSTYLE Sets the extended window style of the dialog box.
FONT Sets the font with which the system will draw text for the dialog box.
LANGUAGE Sets the language for all resources up to the next LANGUAGE statement or to the end of the file. When the LANGUAGE statement appears before the beginning of the body of an ACCELERATORS, DIALOG, MENU, RCDATA, or STRINGTABLE resource definition, the specified language applies only to that resource.
MENU Sets the menu for the dialog box.
MENUITEM Defines a menu item.
STYLE Sets the window style for the dialog box.
VERSION Specifies version information for a resource that can be used by tool that can read or write resource-definition files.