使用资源文件Working with Resource Files

警告

本节适用于采用 C++ 编写的 Windows 桌面应用程序。This section applies to Windows desktop applications written in C++.

有关以 c + + 编写的通用 Windows 平台应用中的资源的信息,请参阅 定义应用资源,或在将资源添加到 c + +/cli (托管) 项目中,参阅《 .NET Framework 开发人员指南》中的 桌面应用 中的资源。For information about resources in Universal Windows Platform apps written in C++, see Defining App Resources, or on adding resources to C++/CLI (managed) projects, see Resources in Desktop Apps in the .NET Framework Developer's Guide.

资源可以由各种各样的元素组成,如下所示:Resources can be composed of a wide range of elements, like:

  • 向用户提供信息(如位图、图标或光标)的接口元素。Interface elements that provide information to the user such as a bitmap, icon, or cursor.
  • 包含数据和应用程序需求的自定义资源。Custom resources that contain data and application needs.
  • 安装 Api 使用的版本资源。Version resources that are used by setup APIs.
  • 菜单和对话框资源。Menu and dialog box resources.

可以向项目添加新资源并使用适当的资源编辑器修改这些资源。You can add new resources to your project and modify those resources using the appropriate resource editor. 大多数 Visual C++ 向导自动为项目生成 .rc 文件。Most Visual C++ wizards will automatically generate an .rc file for your project.

备注

资源编辑器资源视图 在 Express 版本中不可用。The Resource Editors and Resource View aren't available in Express editions.

若要手动将资源文件添加到托管项目,请参阅 创建桌面应用的资源文件To manually add resource files to managed projects, see Creating Resource Files for Desktop Apps. 本文包括如何访问资源、显示静态资源和将资源字符串分配给属性。This article includes how to access resources, display static resources, and assign resource strings to properties.

若要全球化和本地化托管应用中的资源,请参阅 .NET Framework 应用程序进行全球化和本地化To globalize and localize resources in managed apps, see Globalizing and Localizing .NET Framework Applications.

本节内容In This Section

资源文件Resource Files
描述资源文件以及在 Windows 桌面应用程序中使用它们的方式。Describes resource files and how they're used in Windows desktop applications. 还提供指向描述如何使用资源文件的文章的链接。Also provides links to articles that describe how to use resource files.

(符号的资源标识符) Resource Identifiers (Symbols)
描述符号并提供有关在项目中使用 “资源符号” 对话框管理符号的信息。Describes symbols and provides information on using the Resource Symbols dialog box to manage symbols in your projects.

资源编辑器Resource Editors
介绍 Visual Studio 中提供的资源编辑器,以及可通过每个编辑器修改的资源类型。Describes the resource editors provided in Visual Studio and the types of resources you can modify with each editor. 还提供了有关使用每个编辑器的详细信息的链接。Also provides links to detailed information on using each editor.

Visual Studio 中的 C++C++ in Visual Studio
提供 Visual C++ 文档的链接。Provides links into the Visual C++ documentation.

与我们交流Talk to Us
提供指向特定信息的链接,这些信息说明如何使用文档集、如何与产品支持部门联系以及如何使用辅助功能。Provides links to information on using the documentation set, contacting product support, and employing accessibility features.

请参阅See also

Windows 桌面应用程序Windows Desktop Applications
菜单和其他资源Menus and Other Resources