You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit dca9870
Browse filesBrowse the repository at this point in the historyBrowse files
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
9
13
10
14
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.
11
15
@@ -16,46 +20,46 @@ You can easily copy resources from an existing resource or executable file to yo
16
20
17
21
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).
18
22
19
-
## To copy resources between files using the drag-and-drop method
23
+
###To copy resources between files using the drag-and-drop method
20
24
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*.
22
26
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**.
24
28
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*.
26
30
27
31
> [!NOTE]
28
32
> Dragging the resource without holding down the **Ctrl** key moves the resource rather than copying it.
29
33
30
-
## To copy resources using copy and paste
34
+
###To copy resources using copy and paste
31
35
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*.
33
37
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.
35
39
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.
37
41
38
42
> [!NOTE]
39
43
> 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.
40
44
41
45
> [!NOTE]
42
46
> 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.
43
47
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
45
49
46
50
While copying in a resource, you can change its language property or condition property, or both.
47
51
48
52
- 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.)
49
53
50
54
- 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.
51
55
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`.
53
57
54
58
```cpp
55
59
IDD_AboutBox (Finnish - XX33)
56
60
```
57
61
58
-
### To copy an existing resource and change its language or condition
62
+
To copy an existing resource and change its language or condition:
59
63
60
64
1. In the .rc file or in the [Resource View](../windows/resource-view-window.md) window, right-click the resource you want to copy.
61
65
@@ -67,7 +71,39 @@ IDD_AboutBox (Finnish - XX33)
67
71
68
72
- In the **Condition** box, type the condition.
69
73
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**.
[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/>
0 commit comments