Skip to content

Commit 2dacfbc

Browse files
author
msebolt
committed
resource file consolidation pr34
1 parent 2505a94 commit 2dacfbc

6 files changed

Lines changed: 74 additions & 122 deletions

‎.openpublishing.redirection.json‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7755,6 +7755,21 @@
77557755
"redirect_url": "/cpp/windows/viewing-resource-symbols",
77567756
"redirect_document_id": false
77577757
},
7758+
{
7759+
"source_path": "docs/windows/add-resource-dialog-box.md",
7760+
"redirect_url": "/cpp/windows/how-to-create-a-resource",
7761+
"redirect_document_id": false
7762+
},
7763+
{
7764+
"source_path": "docs/windows/new-custom-resource-dialog-box.md",
7765+
"redirect_url": "/cpp/windows/how-to-create-a-resource",
7766+
"redirect_document_id": false
7767+
},
7768+
{
7769+
"source_path": "docs/windows/resource-view-window.md",
7770+
"redirect_url": "/cpp/windows/how-to-create-a-resource",
7771+
"redirect_document_id": false
7772+
},
77587773
{
77597774
"source_path": "docs/windows/activationfactory-activationfactory-constructor.md",
77607775
"redirect_url": "/cpp/windows/activationfactory-class#activationfactory",

‎docs/windows/TOC.md‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@
1212
### [Resource Files (Visual Studio)](resource-files-visual-studio.md)
1313
#### [How to: Create a Resource Script File](how-to-create-a-resource-script-file.md)
1414
#### [How to: Create a Resource](how-to-create-a-resource.md)
15-
##### [Resource View Window](resource-view-window.md)
16-
##### [Add Resource Dialog Box](add-resource-dialog-box.md)
17-
##### [New Custom Resource Dialog Box](new-custom-resource-dialog-box.md)
1815
#### [How to: Open a Resource Script File Outside of a Project (Standalone)](how-to-open-a-resource-script-file-outside-of-a-project-standalone.md)
1916
#### [How to: Open a Resource Script File in Text Format](how-to-open-a-resource-script-file-in-text-format.md)
2017
#### [How to: Add MFC Support to Resource Script Files](how-to-add-mfc-support-to-resource-script-files.md)

‎docs/windows/add-resource-dialog-box.md‎

Lines changed: 0 additions & 41 deletions
This file was deleted.

‎docs/windows/how-to-create-a-resource.md‎

Lines changed: 59 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,91 @@
11
---
22
title: "How to: Create a Resource (C++)"
33
ms.date: "11/04/2016"
4-
helpviewer_keywords: ["toolbars [C++], resources", "resource toolbars", "resources [C++], creating"]
4+
f1_keywords: ["vs.resourceview.F1", "vc.editors.insertresource", "vc.editors.newcustomresource"]
5+
helpviewer_keywords: ["toolbars [C++], resources", "resource toolbars", "resources [C++], creating", "resources [C++], viewing", "Resource View window", "resources [C++], adding", "Add Resource dialog box [C++]", "Custom Resource Type dialog box [C++]"]
56
ms.assetid: aad44914-9145-45a3-a7d8-9de89b366716
67
---
7-
# How to: Create a Resource
8+
# How to: Create a Resource (C++)
9+
10+
The **Resource View** window displays the resource files included in your projects. Expanding the top folder (for example, Project1.rc) shows the resource types within that .rc file. Expanding each resource type shows the individual resources of that type.
11+
12+
> [!NOTE]
13+
> This information does not apply to resources in Universal Windows Platform apps. For more information about that, see [App resources and the Resource Management System](/windows/uwp/app-resources/).
814
915
> [!NOTE]
1016
> **Resource View** is not supported in Express editions.
1117
12-
### To create a new resource in Resource View
18+
For information on adding resources to managed projects, see [Resources in Desktop Apps](/dotnet/framework/resources/index) in the *.NET Framework Developer's Guide*.
1319

14-
1. With focus on your .rc file in [Resource View](../windows/resource-view-window.md), click the **Edit** menu and choose **Add Resource** (or right-click the .rc file in **Resource View** and choose **Add Resource** from the shortcut menu).
20+
> [!NOTE]
21+
> If your project doesn't already contain an .rc file, please see [Creating a New Resource Script File](../windows/how-to-create-a-resource-script-file.md).
1522
16-
> [!NOTE]
17-
> If your project doesn't already contain an .rc file, please see [Creating a New Resource Script File](../windows/how-to-create-a-resource-script-file.md).
23+
The **Resource View** window uses the **Add Resource** dialog box to add resources to a C++ Windows desktop application project. This dialog box has the following properties:
1824

19-
2. In the [Add Resource dialog box](../windows/add-resource-dialog-box.md), choose the type of resource you'd like to add to your project.
25+
|Property|Description|
26+
|---|---|
27+
|**Resource Type**|Specifies the kind of resource you want to create.<br/><br/>You can expand the cursor and dialog box resource categories to reveal additional resources. These resources are located in ...\Microsoft Visual Studio `version`\VC\VCResourceTemplates\\<LCID\>\mfc.rct. If you add .rct files, you must put them in this directory or you must specify an [include path](../windows/how-to-specify-include-directories-for-resources.md) for them. The resources in those files then appear at the second level under the appropriate category. There's no preset limit to the number of .rct files you can add.<br/><br/>The resources shown at the top level in the tree control are the default resources that are provided by Visual Studio.|
28+
|**New**|Creates a resource based on the type you've selected in the **Resource Type** box. The resource opens in the appropriate editor. For example, if you create a dialog resource, it opens in the [dialog editor](../windows/dialog-editor.md).|
29+
|**Import**|Opens the **Import** dialog box in which you can navigate to a resource you'd want to import into your current project. You can import a bitmap, icon, cursor, HTML resource file, sound (.WAV) resource file, or custom resource file.|
30+
|**Custom**|Opens the **New Custom Resource** dialog box in which you can create a custom resource. Custom resources can be edited in the Binary editor only.|
2031

21-
### To create a new resource in Solution Explorer
32+
The **New Custom Resource** dialog box enables you to create a new custom resource in a C++ project. This dialog box has the following property:
2233

23-
1. In **Solution Explorer**, right-click the project folder and choose **Add**, then click **Add Resource** on the shortcut menu.
34+
|Property|Description|
35+
|---|---|
36+
|**Resource Type**|Provides a text box for you to enter the name of a custom resource type. Visual C++ automatically capitalizes the name when you exit the **New Custom Resource** dialog box.|
37+
38+
When you create a new resource, Visual C++ assigns a unique name to it, for example, `IDD_Dialog1`. You can customize this resource ID by editing the properties for the resource either in the associated resource editor or in the [Properties Window](/visualstudio/ide/reference/properties-window).
2439

25-
If you do not already have an .rc file in your project, this step will create one. You can then repeat this step to add specific resource types to the new .rc file.
40+
You can create a resource as a new default resource (a resource that isn't based on a template) or as a resource patterned after a [template](../windows/how-to-use-resource-templates.md).
2641

27-
2. In the [Add Resource dialog box](../windows/add-resource-dialog-box.md), choose the type of resource you'd like to add to your project.
42+
> [!NOTE]
43+
> Do not specify a resource name or ID that is reserved by Visual Studio. The reserved names are DESIGNINFO, HWB, and TEXTINCLUDE, and the reserved ID is 255.
2844
29-
### To create a new resource in Class View
45+
## To open the resource view window
3046

31-
1. In [Class View](/visualstudio/ide/viewing-the-structure-of-code), right-click your class and choose **Add**, then click **Add Resource** from the shortcut menu.
47+
Select **Resource View** on the **View** menu.
3248

33-
2. In the [Add Resource dialog box](../windows/add-resource-dialog-box.md), choose the type of resource you'd like to add to your project.
49+
\- or -
3450

35-
### To create a new resource from the Project menu
51+
Press **Ctrl** + **Shift** + **E**.
3652

37-
1. From the **Project** menu, choose **Add Resource**.
53+
> [!TIP]
54+
> You can right-click on the **Resource View** window to launch a shortcut menu of commands. You can also double-click on the title bar to dock or undock the window. Right-clicking on the title bar will give you additional commands that allow you to control the behavior of the window. For more information, see [Windows Management](/visualstudio/ide/customizing-window-layouts-in-visual-studio).
3855
39-
When you create a new resource, Visual C++ assigns a unique name to it, for example, `IDD_Dialog1`. You can customize this resource ID by editing the properties for the resource either in the associated resource editor or in the [Properties Window](/visualstudio/ide/reference/properties-window).
56+
## To create a new resource in Resource View
57+
58+
1. With focus on your .rc file in **Resource View**, select the **Edit** menu and choose **Add Resource** (or right-click the .rc file in **Resource View** and choose **Add Resource** from the shortcut menu).
59+
60+
> [!NOTE]
61+
> If your project doesn't already contain an .rc file, please see [Creating a New Resource Script File](../windows/how-to-create-a-resource-script-file.md).
62+
63+
1. In the **Add Resource** dialog box, choose the type of resource you'd like to add to your project.
64+
65+
## To create a new resource in Solution Explorer
66+
67+
1. In **Solution Explorer**, right-click the project folder and choose **Add**, then click **Add Resource** on the shortcut menu.
68+
69+
If you don't already have an .rc file in your project, this step will create one. You can then repeat this step to add specific resource types to the new .rc file.
70+
71+
2. In the **Add Resource** dialog box, choose the type of resource you'd like to add to your project.
72+
73+
## To create a new resource in Class View
74+
75+
1. In [Class View](/visualstudio/ide/viewing-the-structure-of-code), right-click your class and choose **Add**, then select **Add Resource** from the shortcut menu.
76+
77+
2. In the **Add Resource** dialog box, choose the type of resource you'd like to add to your project.
4078

41-
You can create a resource as a new default resource (a resource that is not based on a template) or as a resource patterned after a [template](../windows/how-to-use-resource-templates.md).
79+
## To create a new resource from the Project menu
4280

43-
For information on adding resources to managed projects, please see [Resources in Desktop Apps](/dotnet/framework/resources/index) in the *.NET Framework Developer's Guide*.
81+
From the **Project** menu, choose **Add Resource**.
4482

4583
## Requirements
4684

4785
Win32
4886

49-
## See Also
87+
## See also
5088

89+
[Working with Resource Files](../windows/working-with-resource-files.md)<br/>
5190
[Resource Files](../windows/resource-files-visual-studio.md)<br/>
5291
[Resource Editors](../windows/resource-editors.md)<br/>
53-
[Add Resource Dialog Box](../windows/add-resource-dialog-box.md)

‎docs/windows/new-custom-resource-dialog-box.md‎

Lines changed: 0 additions & 22 deletions
This file was deleted.

‎docs/windows/resource-view-window.md‎

Lines changed: 0 additions & 35 deletions
This file was deleted.

0 commit comments

Comments
 (0)