Skip to content

Commit dca9870

Browse files
authored
Merge pull request MicrosoftDocs#1754 from msebolt/resource-file-consolidation-pr49
resource file consolidation pr49
2 parents efd3054 + 27a92f5 commit dca9870

5 files changed

Lines changed: 64 additions & 80 deletions

File tree

‎.openpublishing.redirection.json‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7955,6 +7955,16 @@
79557955
"redirect_url": "/cpp/windows/how-to-create-a-resource-script-file",
79567956
"redirect_document_id": false
79577957
},
7958+
{
7959+
"source_path": "docs/windows/editing-managed-resource-files.md",
7960+
"redirect_url": "/cpp/windows/how-to-copy-resources",
7961+
"redirect_document_id": false
7962+
},
7963+
{
7964+
"source_path": "docs/windows/how-to-import-and-export-resources.md",
7965+
"redirect_url": "/cpp/windows/how-to-copy-resources",
7966+
"redirect_document_id": false
7967+
},
79587968
{
79597969
"source_path": "docs/windows/activationfactory-activationfactory-constructor.md",
79607970
"redirect_url": "/cpp/windows/activationfactory-class#activationfactory",

‎docs/windows/TOC.md‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,10 @@
1111
## [Working with Resource Files](working-with-resource-files.md)
1212
### [Resource Files (Visual Studio)](resource-files-visual-studio.md)
1313
#### [How to: Create Resources](how-to-create-a-resource-script-file.md)
14+
#### [How to: Manage Resources](how-to-copy-resources.md)
1415
#### [How to: Include Resources at Compile Time](how-to-include-resources-at-compile-time.md)
15-
#### [How to: Copy Resources](how-to-copy-resources.md)
1616
#### [How to: Search for Symbols in Resources](how-to-search-for-symbols-in-resources.md)
17-
#### [How to: Import and Export Resources](how-to-import-and-export-resources.md)
1817
#### [Editable File Types for Resources](editable-file-types-for-resources.md)
19-
#### [Editing Managed Resource Files](editing-managed-resource-files.md)
2018
#### [Manifest Resources](manifest-resources.md)
2119
### [Symbols: Resource Identifiers](symbols-resource-identifiers.md)
2220
#### [Viewing Resource Symbols](viewing-resource-symbols.md)

‎docs/windows/editing-managed-resource-files.md‎

Lines changed: 0 additions & 14 deletions
This file was deleted.
Lines changed: 53 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
---
2-
title: "How to: Copy Resources (C++)"
2+
title: "How to: Manage Resources (C++)"
33
ms.date: "11/04/2016"
4-
f1_keywords: ["vc.resvw.resource.copying", "vs.resvw.resource.copying", "vc.resvw.resource.changing"]
5-
helpviewer_keywords: ["resources [C++], moving between files", "resources [C++], copying", "resource files [C++], copying or moving resources between", "resource files [C++], tiling", ".rc files [C++], copying resources between", "rc files [C++], copying resources between", "Language property [C++]"]
4+
f1_keywords: ["vc.resvw.resource.copying", "vs.resvw.resource.copying", "vc.resvw.resource.changing", "vb.xmldesigner.data", "vs.resvw.resource.importing", "vc.resvw.resource.importing"]
5+
helpviewer_keywords: ["resources [C++], moving between files", "resources [C++], copying", "resource files [C++], copying or moving resources between", "resource files [C++], tiling", ".rc files [C++], copying resources between", "rc files [C++], copying resources between", "Language property [C++]", ".resx files [C++], editing", "resource files [C++], editing", "resx files [C++], editing", "resources [C++], exporting", "graphics [C++], exporting", "graphics [C++], importing", "resources [C++], importing", "bitmaps [C++], importing and exporting", "toolbars [C++], importing", "images [C++], importing", "toolbars [C++], exporting", "cursors [C++], importing and exporting", "images [C++], exporting"]
66
ms.assetid: 65f523e8-017f-4fc6-82d1-083c56d9131f
77
---
8-
# How to: Copy Resources (C++)
8+
# How to: Manage Resources (C++)
9+
10+
For information on adding resources to managed projects, see [Resources in Desktop Apps](/dotnet/framework/resources/index) in the *.NET Framework Developer's Guide*. For information on manually adding resource files to managed projects, accessing resources, displaying static resources, and assigning resource strings to properties, see [Creating Resource Files for Desktop Apps](/dotnet/framework/resources/creating-resource-files-for-desktop-apps). For information on globalization and localization of resources in managed apps, see [Globalizing and Localizing .NET Framework Applications](/dotnet/standard/globalization-localization/index).
11+
12+
## To copy resources
913

1014
You can copy resources from one file to another without changing them or you can change the language or condition of a resource while copying it.
1115

@@ -16,46 +20,46 @@ You can easily copy resources from an existing resource or executable file to yo
1620
1721
You can use the drag-and-drop method between .rc files that are open [outside of the project](../windows/how-to-open-a-resource-script-file-outside-of-a-project-standalone.md).
1822

19-
## To copy resources between files using the drag-and-drop method
23+
### To copy resources between files using the drag-and-drop method
2024

21-
1. Open both resource files stand-alone (for more information, see [Viewing Resources in an .rc File Outside of a Project](../windows/how-to-open-a-resource-script-file-outside-of-a-project-standalone.md)). For example, open Source1.rc and Source2.rc.
25+
1. Open both resource files stand-alone (for more information, see [view resources in an .rc file outside of a project](../windows/how-to-open-a-resource-script-file-outside-of-a-project-standalone.md)). For example, open *Source1.rc* and *Source2.rc*.
2226

23-
1. Inside the first .rc file, select the resource you wish to copy. For example, in `Source1.rc`, select **IDD_DIALOG1**.
27+
1. Inside the first .rc file, select the resource you wish to copy. For example, in *Source1.rc*, select **IDD_DIALOG1**.
2428

25-
1. Hold down the **Ctrl** key and drag the resource to the second .rc file. For example, drag **IDD_DIALOG1** from `Source1.rc` to `Source2.rc`.
29+
1. Hold down the **Ctrl** key and drag the resource to the second .rc file. For example, drag **IDD_DIALOG1** from *Source1.rc* to *Source2.rc*.
2630

2731
> [!NOTE]
2832
> Dragging the resource without holding down the **Ctrl** key moves the resource rather than copying it.
2933
30-
## To copy resources using copy and paste
34+
### To copy resources using copy and paste
3135

32-
1. Open both resource files stand-alone (for more information, see [Viewing Resources in an .rc File Outside of a Project](../windows/how-to-open-a-resource-script-file-outside-of-a-project-standalone.md)). For example, Source1.rc and Source2.rc.
36+
1. Open both resource files stand-alone (for more information, see [view resources in an .rc file outside of a project](../windows/how-to-open-a-resource-script-file-outside-of-a-project-standalone.md)). For example, *Source1.rc* and *Source2.rc*.
3337

34-
1. In the source file from which you wish to copy a resource (for example, `Source1.rc`), right-click a resource and choose **Copy** from the shortcut menu.
38+
1. In the source file from which you wish to copy a resource (for example, *Source1.rc*), right-click a resource and choose **Copy** from the shortcut menu.
3539

36-
1. Right-click the resource file into which you'd like to paste the resource (for example, `Source2.rc`). Choose **Paste** from the shortcut menu.
40+
1. Right-click the resource file into which you'd like to paste the resource (for example, *Source2.rc*). Choose **Paste** from the shortcut menu.
3741

3842
> [!NOTE]
3943
> You cannot drag and drop, copy, cut, or paste between resource files in the project (**Resource View**) and stand-alone .rc files (those open in document windows). You could do this in previous versions of the product.
4044
4145
> [!NOTE]
4246
> To avoid conflicts with symbol names or values in the existing file, Visual C++ may change the transferred resource's symbol value or symbol name and value when you copy it to the new file.
4347
44-
## To change the language or condition of a resource while copying (C++)
48+
### To change the language or condition of a resource while copying
4549

4650
While copying in a resource, you can change its language property or condition property, or both.
4751

4852
- The language of the resource identifies just that, the language for the resource. The language is used by [FindResource](/windows/desktop/api/winbase/nf-winbase-findresourcea) to help identify the resource for which you're looking. (However, resources can have differences for each language that aren't related to text, for example, accelerators that might only work on a Japanese keyboard or a bitmap that would only be appropriate for Chinese localized builds.)
4953

5054
- The condition of a resource is a defined symbol that identifies a condition under which this particular copy of the resource is to be used.
5155

52-
The language and condition of a resource are shown in parentheses after the name of the resource in the Workspace window. In this example, the resource named IDD_AboutBox is using Finnish as its language and its condition is XX33.
56+
The language and condition of a resource are shown in parentheses after the name of the resource in the **Workspace** window. In this example, the resource named `IDD_AboutBox` is using `Finnish` as its language and its condition is `XX33`.
5357

5458
```cpp
5559
IDD_AboutBox (Finnish - XX33)
5660
```
5761
58-
### To copy an existing resource and change its language or condition
62+
To copy an existing resource and change its language or condition:
5963
6064
1. In the .rc file or in the [Resource View](../windows/resource-view-window.md) window, right-click the resource you want to copy.
6165
@@ -67,7 +71,39 @@ IDD_AboutBox (Finnish - XX33)
6771
6872
- In the **Condition** box, type the condition.
6973
70-
For information on adding resources to managed projects, see [Resources in Desktop Apps](/dotnet/framework/resources/index) in the *.NET Framework Developer's Guide*. For information on manually adding resource files to managed projects, accessing resources, displaying static resources, and assigning resource strings to properties, see [Creating Resource Files for Desktop Apps](/dotnet/framework/resources/creating-resource-files-for-desktop-apps). For information on globalization and localization of resources in managed apps, see [Globalizing and Localizing .NET Framework Applications](/dotnet/standard/globalization-localization/index).
74+
## To edit managed resource files
75+
76+
Managed resource files (.resx) are XML files. When you add a managed resource file to your project from the **Add New Item** dialog box, the **Managed Resources Editor** opens by default.
77+
78+
## To import and export resources
79+
80+
You can import graphical resources (bitmaps, icons, cursors, and toolbars), HTML files, and custom resources for use in Visual C++. You can export the same types of files from a Visual C++ project to separate files that can be used outside the development environment.
81+
82+
> [!NOTE]
83+
> Resource types such as accelerators, dialog boxes, and string tables cannot be imported or exported because they are not stand-alone file types.
84+
85+
### To import an individual resource into your current resource file
86+
87+
1. In [Resource View](../windows/resource-view-window.md), right-click the node for the resource script (*.rc) file to which you want to add a resource.
88+
89+
1. Select **Import** on the shortcut menu.
90+
91+
1. Locate and select the file name of the bitmap (.bmp), icon (.ico), cursor (.cur), Html file (.htm), or other file that you want to import.
92+
93+
1. Choose **OK** to add the resource to the selected file in **Resource** view.
94+
95+
> [!NOTE]
96+
> The import process works the same way no matter which particular resource type you have selected. The imported resource is automatically added to the correct node for that resource type.
97+
98+
### To export a bitmap, icon, or cursor as a separate file (for use outside of Visual C++)
99+
100+
1. In **Resource** view, right-click the resource you want to export.
101+
102+
1. Select **Export** on the shortcut menu.
103+
104+
1. In the **Export Resource** dialog box, accept the current file name or type a new one.
105+
106+
1. Navigate to the folder where you want to save the file and choose **Export**.
71107
72108
## Requirements
73109
@@ -76,5 +112,4 @@ Win32
76112
## See also
77113
78114
[Resource Files](../windows/resource-files-visual-studio.md)<br/>
79-
[Resource Editors](../windows/resource-editors.md)<br/>
80-
[How to: Open a Resource Script File Outside of a Project (Standalone)](../windows/how-to-open-a-resource-script-file-outside-of-a-project-standalone.md)<br/>
115+
[Resource Editors](../windows/resource-editors.md)

‎docs/windows/how-to-import-and-export-resources.md‎

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

0 commit comments

Comments
 (0)