Skip to content

Commit 9027735

Browse files
authored
Merge branch 'main' into WASDK/1.7/1.7.5-ReleaseNotes
2 parents b841bac + 632dd2c commit 9027735

34 files changed

Lines changed: 444 additions & 280 deletions

.openpublishing.redirection.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9564,6 +9564,16 @@
95649564
"source_path": "hub/apps/develop/launch/launch-settings-app.md",
95659565
"redirect_url": "/windows/apps/develop/launch/launch-settings",
95669566
"redirect_document_id": false
9567+
},
9568+
{
9569+
"source_path": "uwp/app-to-app/copy-and-paste.md",
9570+
"redirect_url": "/windows/apps/develop/communication/copy-and-paste",
9571+
"redirect_document_id": false
9572+
},
9573+
{
9574+
"source_path": "hub/apps/develop/communication.md",
9575+
"redirect_url": "/windows/apps/develop/communication/",
9576+
"redirect_document_id": false
95679577
}
95689578
]
95699579
}
Lines changed: 194 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,194 @@
1+
---
2+
description: Learn how to implement copy and paste functionality in WinUI and UWP apps using the clipboard APIs. Includes code examples and best practices.
3+
title: Copy and Paste in WinUI and UWP Apps
4+
ms.date: 10/15/2025
5+
ms.topic: how-to
6+
keywords: windows 11, uwp, winrt, windows runtime, winui
7+
ms.localizationpriority: medium
8+
# Customer intent: As a Windows app developer, I want to learn how to implement copy and paste functionality in my app using the clipboard.
9+
---
10+
11+
# Copy and paste
12+
13+
Copy and paste is a fundamental way for users to exchange data between apps or within an app. This article shows you how to implement copy and paste in WinUI and Universal Windows Platform (UWP) apps using the clipboard APIs. You'll learn how to copy, cut, and paste data, track clipboard changes, and use the [DataPackage](/uwp/api/Windows.ApplicationModel.DataTransfer.DataPackage) class to handle different data formats.
14+
15+
> [!NOTE]
16+
> You can also use these APIs in other desktop apps through Windows Runtime (WinRT) APIs. For more information, see [Call Windows Runtime APIs in desktop apps](/windows/apps/desktop/modernize/desktop-to-uwp-enhance).
17+
18+
For complete code examples that demonstrate different copy and paste scenarios, see the [UWP clipboard sample on GitHub](https://github.com/microsoft/Windows-universal-samples/tree/master/Samples/Clipboard).
19+
20+
## Check for built-in clipboard support
21+
22+
In many cases, you do not need to write code to support clipboard operations. Many of the default XAML controls you can use to create apps already support clipboard operations.
23+
24+
## Get set up
25+
26+
First, include the [Windows.ApplicationModel.DataTransfer](/uwp/api/Windows.ApplicationModel.DataTransfer) namespace in your app. Then, add an instance of the [DataPackage](/uwp/api/Windows.ApplicationModel.DataTransfer.DataPackage) object. This object contains both the data the user wants to copy and any properties (such as a description) that you want to include.
27+
28+
### [C#](#tab/cs)
29+
30+
```cs
31+
using Windows.ApplicationModel.DataTransfer;
32+
...
33+
var dataPackage = new DataPackage();
34+
```
35+
36+
### [C++/WinRT](#tab/cppwinrt)
37+
38+
```cppwinrt
39+
#include <winrt/Windows.ApplicationModel.DataTransfer.h>
40+
using namespace winrt::Windows::ApplicationModel::DataTransfer;
41+
...
42+
DataPackage dataPackage;
43+
```
44+
45+
---
46+
47+
## Copy and cut
48+
49+
Copy and cut (also referred to as *move*) work almost exactly the same. Choose which operation you want by using the [RequestedOperation](/uwp/api/windows.applicationmodel.datatransfer.datapackage.requestedoperation) property.
50+
51+
### [C#](#tab/cs)
52+
53+
```cs
54+
// copy
55+
dataPackage.RequestedOperation = DataPackageOperation.Copy;
56+
// or cut
57+
dataPackage.RequestedOperation = DataPackageOperation.Move;
58+
```
59+
60+
### [C++/WinRT](#tab/cppwinrt)
61+
62+
```cppwinrt
63+
// copy
64+
dataPackage.RequestedOperation(DataPackageOperation::Copy);
65+
// or cut
66+
dataPackage.RequestedOperation(DataPackageOperation::Move);
67+
```
68+
69+
---
70+
71+
## Set the copied content
72+
73+
Next, you can add the data that a user has selected to the [DataPackage](/uwp/api/Windows.ApplicationModel.DataTransfer.DataPackage) object. If this data is supported by the **DataPackage** class, you can use one of the corresponding [methods](/uwp/api/windows.applicationmodel.datatransfer.datapackage#methods) of the **DataPackage** object. Here's how to add text by using the [SetText](/uwp/api/windows.applicationmodel.datatransfer.datapackage.settext) method:
74+
75+
### [C#](#tab/cs)
76+
77+
```cs
78+
dataPackage.SetText("Hello World!");
79+
```
80+
81+
### [C++/WinRT](#tab/cppwinrt)
82+
83+
```cppwinrt
84+
dataPackage.SetText(L"Hello World!");
85+
```
86+
87+
---
88+
89+
The last step is to add the [DataPackage](/uwp/api/Windows.ApplicationModel.DataTransfer.DataPackage) to the clipboard by calling the static [SetContent](/uwp/api/windows.applicationmodel.datatransfer.clipboard.setcontent) method.
90+
91+
### [C#](#tab/cs)
92+
93+
```cs
94+
Clipboard.SetContent(dataPackage);
95+
```
96+
97+
### [C++/WinRT](#tab/cppwinrt)
98+
99+
```cppwinrt
100+
Clipboard::SetContent(dataPackage);
101+
```
102+
103+
---
104+
105+
## Paste
106+
107+
To get the contents of the clipboard, call the static [GetContent](/uwp/api/windows.applicationmodel.datatransfer.clipboard.getcontent) method. This method returns a [DataPackageView](/uwp/api/Windows.ApplicationModel.DataTransfer.DataPackageView) that contains the content. This object is almost identical to a [DataPackage](/uwp/api/Windows.ApplicationModel.DataTransfer.DataPackage) object, except that its contents are read-only. With that object, you can use either the [AvailableFormats](/uwp/api/windows.applicationmodel.datatransfer.datapackageview.availableformats) or the [Contains](/uwp/api/windows.applicationmodel.datatransfer.datapackageview.contains) method to identify what formats are available. Then, you can call the corresponding [DataPackageView](/uwp/api/Windows.ApplicationModel.DataTransfer.DataPackageView) method to get the data.
108+
109+
### [C#](#tab/cs)
110+
111+
```cs
112+
async void OutputClipboardText()
113+
{
114+
DataPackageView dataPackageView = Clipboard.GetContent();
115+
if (dataPackageView.Contains(StandardDataFormats.Text))
116+
{
117+
string text = await dataPackageView.GetTextAsync();
118+
// To output the text from this example, you need a TextBlock control
119+
TextOutput.Text = "Clipboard now contains: " + text;
120+
}
121+
}
122+
```
123+
124+
### [C++/WinRT](#tab/cppwinrt)
125+
126+
```cppwinrt
127+
void MainPage::OutputClipboardText()
128+
{
129+
DataPackageView dataPackageView = Clipboard::GetContent();
130+
if (dataPackageView.Contains(StandardDataFormats::Text()))
131+
{
132+
hstring text = dataPackageView.GetTextAsync().get();
133+
// To output the text from this example, you need a TextBlock control
134+
TextOutput().Text(L"Clipboard now contains: " + text);
135+
}
136+
}
137+
```
138+
139+
---
140+
141+
## Track changes to the clipboard
142+
143+
In addition to copy and paste commands, you may also want to track clipboard changes. Do this by handling the clipboard's [ContentChanged](/uwp/api/windows.applicationmodel.datatransfer.clipboard.contentchanged) event.
144+
145+
### [C#](#tab/cs)
146+
147+
```cs
148+
Clipboard.ContentChanged += async (s, e) =>
149+
{
150+
DataPackageView dataPackageView = Clipboard.GetContent();
151+
if (dataPackageView.Contains(StandardDataFormats.Text))
152+
{
153+
string text = await dataPackageView.GetTextAsync();
154+
// To output the text from this example, you need a TextBlock control
155+
TextOutput.Text = "Clipboard now contains: " + text;
156+
}
157+
}
158+
```
159+
### [C++/WinRT](#tab/cppwinrt)
160+
161+
```cppwinrt
162+
Clipboard::ContentChanged([this](auto const&, auto const&)
163+
{
164+
DataPackageView dataPackageView = Clipboard::GetContent();
165+
if (dataPackageView.Contains(StandardDataFormats::Text()))
166+
{
167+
hstring text = dataPackageView.GetTextAsync().get();
168+
// To output the text from this example, you need a TextBlock control
169+
TextOutput().Text(L"Clipboard now contains: " + text);
170+
}
171+
});
172+
```
173+
174+
---
175+
176+
## Related content
177+
178+
- [Clipboard sample](https://github.com/microsoft/Windows-universal-samples/tree/master/Samples/Clipboard)
179+
- [Communication](index.md)
180+
- [DataTransfer](/uwp/api/windows.applicationmodel.datatransfer)
181+
- [DataPackage](/uwp/api/windows.applicationmodel.datatransfer.datapackage)
182+
- [DataPackageView](/uwp/api/windows.applicationmodel.datatransfer.datapackageview)
183+
- [DataPackagePropertySet]( /uwp/api/Windows.ApplicationModel.DataTransfer.DataPackagePropertySet)
184+
- [DataRequest](/uwp/api/windows.applicationmodel.datatransfer.datarequest)
185+
- [DataRequested]( /uwp/api/Windows.ApplicationModel.DataTransfer.DataTransferManager)
186+
- [FailWithDisplayText](/uwp/api/windows.applicationmodel.datatransfer.datarequest.failwithdisplaytext)
187+
- [ShowShareUi](/uwp/api/windows.applicationmodel.datatransfer.datatransfermanager.showshareui)
188+
- [RequestedOperation](/uwp/api/windows.applicationmodel.datatransfer.datapackage.requestedoperation)
189+
- [ControlsList](/windows/apps/design/controls/index)
190+
- [SetContent](/uwp/api/windows.applicationmodel.datatransfer.clipboard.setcontent)
191+
- [GetContent](/uwp/api/windows.applicationmodel.datatransfer.clipboard.getcontent)
192+
- [AvailableFormats](/uwp/api/windows.applicationmodel.datatransfer.datapackageview.availableformats)
193+
- [Contains](/uwp/api/windows.applicationmodel.datatransfer.datapackageview.contains)
194+
- [ContentChanged](/uwp/api/windows.applicationmodel.datatransfer.clipboard.contentchanged)
Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
---
2-
title: Communication
3-
description: This article provides an index of development features that are related to communication scenarios in Windows apps.
4-
ms.topic: article
5-
ms.date: 10/13/2021
6-
keywords:
2+
title: Communication features for Windows apps
3+
description: Discover communication features and APIs for Windows apps, including networking, data sharing, and interprocess communication. Learn how to implement these capabilities.
4+
ms.topic: concept-article
5+
ms.date: 10/13/2025
6+
# Customer intent: As a Windows app developer, I want to learn about communication features and APIs that I can use in my Windows apps.
77
---
88

99
# Communication
1010

11-
This article provides an index of development features that are related to scenarios involving communication in Windows apps.
11+
Communication features enable Windows apps to share data, connect over networks, and interact with other applications. This article provides an index of development features for implementing communication scenarios in Windows apps.
1212

1313
> [!NOTE]
14-
> The [Windows App SDK](../windows-app-sdk/index.md) currently does not provide APIs related to communication scenarios.
14+
> The [Windows App SDK](../../windows-app-sdk/index.md) currently does not provide APIs related to communication scenarios. However, in Windows 11 you can share data between apps by integrating with the [Windows Share Sheet](../windows-integration/integrate-sharesheet-overview.md) in packaged and unpackaged desktop apps.
1515
1616
## Windows OS features
1717

@@ -23,6 +23,7 @@ The following articles provide information about features available via WinRT AP
2323

2424
| Article | Description |
2525
|---------|-------------|
26+
| [Copy and paste](copy-and-paste.md) | Learn how to implement copy and paste functionality in your WinUI, UWP, or other desktop app using the clipboard. |
2627
| [App-to-app communication](/windows/uwp/app-to-app/) | Learn how to share data between apps, including how to use the Share contract, copy and paste, drag and drop, and app services. |
2728
| [Interprocess communication](/windows/uwp/communication/interprocess-communication) | Learn about ways to perform interprocess communication (IPC) between UWP apps, packaged desktop apps, and unpackaged desktop apps. |
2829
| [Networking and web services](/windows/uwp/networking/) | Learn about networking and web services technologies that are available to apps. |
@@ -46,3 +47,11 @@ The .NET SDK also provides APIs related to communication scenarios for WPF and W
4647
|---------|-------------|
4748
| [Network programming in the .NET Framework](/dotnet/framework/network-programming/) | Learn about building network-enabled apps using .NET. |
4849
| [Networking in Windows Forms](/dotnet/framework/winforms/advanced/networking-in-windows-forms-applications) | Learn about additional networking scenarios for Windows Forms apps. |
50+
51+
## Related content
52+
53+
[App-to-app communication](/windows/uwp/app-to-app/)
54+
55+
[Develop Windows desktop apps](../index.md)
56+
57+
[Integrate Share options in your Windows app](../windows-integration/integrate-sharesheet-overview.md)

hub/apps/develop/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ The following articles provide information to help you get started using feature
4040
* [User interface and input](user-interface.md)
4141
* [App lifecycle and system services](app-lifecycle-and-system-services.md)
4242
* [Launching Windows apps and managing background tasks](launch/index.md)
43-
* [Communication](communication.md)
43+
* [Communication](communication/index.md)
4444
* [Accessibility](accessibility.md)
4545
* [Audio, video, and camera](audio-video-camera.md)
4646
* [Graphics](graphics.md)

hub/apps/develop/notifications/push-notifications/push-quickstart.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ In this quickstart you will create a desktop Windows application that sends and
1818

1919
- [Start developing Windows apps](../../../get-started/start-here.md)
2020
- Either [Create a new project that uses the Windows App SDK](../../../winui/winui3/create-your-first-winui3-app.md) OR [Use the Windows App SDK in an existing project](../../../windows-app-sdk/use-windows-app-sdk-in-existing-project.md)
21-
- An [Azure Account](https://azure.microsoft.com/free/) is required in order to use Windows App SDK push notifications.
21+
- An [Azure Account](https://azure.microsoft.com/pricing/purchase-options/azure-account?cid=msft_learn) is required in order to use Windows App SDK push notifications.
2222
- Read [Push notifications overview](../../../windows-app-sdk/notifications/push-notifications/index.md)
2323

2424
## Sample app

hub/apps/develop/windows-integration/integrate-sharesheet-overview.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ In this comprehensive guide, you'll learn how to add the share feature to your p
2727

2828
## See also
2929

30-
- [Communication - Windows apps](/windows/apps/develop/communication)
30+
- [Communication - Windows apps](/windows/apps/develop/communication/)
3131
- [Windows App SDK deployment overview](/windows/apps/package-and-deploy/deploy-overview)
3232
- [Create your first WinUI 3 project](/windows/apps/winui/winui3/create-your-first-winui3-app)
3333
- [Migrate from UWP to the Windows App SDK](/windows/apps/windows-app-sdk/migrate-to-windows-app-sdk/migrate-to-windows-app-sdk-ovw)

hub/apps/publish/store-policies.md

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -633,24 +633,21 @@ All products should adhere to the Microsoft Store Policies listed above. If your
633633

634634
### Microsoft Store complaint and appeal statistics
635635

636-
Numbers reported on numbers reported on 7/2/2024 (from 7/1/2023 – 6/30/2024)
636+
Numbers reported from 7/1/2024 - 7/1/2025:
637637

638-
639-
| Statistic (FY2024) | Count |
638+
| Statistic | Count |
640639
|--------------------|----------|
641-
| App and/or Account Enforcement Action Appeals | 829 |
642-
| Complaints about Technological Issues | 36 |
643-
| Regulatory Compliance Complaints | 0 |
644-
| Questions about certification, policy, submission, and technical help | 2,554 |
645-
| Miscellaneous | 663 |
646-
| Total Issues | 4,542 |
647-
| Overturned decisions | 587 |
648-
| Average Processing Time | 2.10 days |
649-
640+
| App and/or Account Enforcement Action Appeals | 1,326 |
641+
| Complaints about Technological Issues | 51 |
642+
| Regulatory Compliance Complaints | 0 |
643+
| Questions about certification, policy, submission, and technical help | 4,040 |
644+
| Miscellaneous | 3,670 |
645+
| Total Issues | 10,126 |
646+
| Overturned decisions | 702 |
647+
| Average Processing Time | 2.85 |
650648

651649
### See also
652650

653651
- [Change history for Microsoft Store Policies](store-policies-change-history.md)
654652
- [Microsoft Store Policies and Code of Conduct](store-policies-and-code-of-conduct.md)
655653
- [App Developer Agreement](https://go.microsoft.com/fwlink/?linkid=528905)
656-

hub/apps/toc.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,11 @@ items:
147147
- name: Connect to remote cameras
148148
href: develop\camera\connect-to-remote-cameras.md
149149
- name: Communication
150-
href: develop/communication.md
150+
items:
151+
- name: Overview
152+
href: develop/communication/index.md
153+
- name: Copy and paste
154+
href: develop/communication/copy-and-paste.md
151155
- name: Data and files
152156
items:
153157
- name: Overview

hub/apps/windows-app-sdk/downloads.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ This page provides links to the *latest* downloads of the [Windows App SDK](inde
2323

2424
| Version | Runtime downloads |
2525
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
26+
| [1.8.2 (1.8.251003001)](stable-channel.md#version-18) <br/> 10/14/2025 <br/> [Release notes](stable-channel.md#version-18) <br/> [Source](https://github.com/microsoft/microsoft-ui-xaml/releases/tag/winui3%2Frelease%2F1.8.2) | [Installer (x64)](https://aka.ms/windowsappsdk/1.8/1.8.251003001/windowsappruntimeinstall-x64.exe) <br/> [Installer (x86)](https://aka.ms/windowsappsdk/1.8/1.8.251003001/windowsappruntimeinstall-x86.exe) <br/> [Installer (arm64)](https://aka.ms/windowsappsdk/1.8/1.8.251003001/windowsappruntimeinstall-arm64.exe) <br/> [Redistributable](https://aka.ms/windowsappsdk/1.8/1.8.251003001/Microsoft.WindowsAppRuntime.Redist.1.8.zip) |
2627
| [1.8.1 (1.8.250916003)](stable-channel.md#version-18) <br/> 09/22/2025 <br/> [Release notes](stable-channel.md#version-18) <br/> [Source](https://github.com/microsoft/microsoft-ui-xaml/releases/tag/winui3%2Frelease%2F1.8.1) | [Installer (x64)](https://aka.ms/windowsappsdk/1.8/1.8.250916003/windowsappruntimeinstall-x64.exe) <br/> [Installer (x86)](https://aka.ms/windowsappsdk/1.8/1.8.250916003/windowsappruntimeinstall-x86.exe) <br/> [Installer (arm64)](https://aka.ms/windowsappsdk/1.8/1.8.250916003/windowsappruntimeinstall-arm64.exe) <br/> [Redistributable](https://aka.ms/windowsappsdk/1.8/1.8.250916003/Microsoft.WindowsAppRuntime.Redist.1.8.zip) |
2728
| [1.8.0 (1.8.250907003)](stable-channel.md#version-18) <br/> 09/09/2025 <br/> [Release notes](stable-channel.md#version-18) <br/> [Source](https://github.com/microsoft/microsoft-ui-xaml/releases/tag/winui3%2Frelease%2F1.8.0) | [Installer (x64)](https://aka.ms/windowsappsdk/1.8/1.8.250907003/windowsappruntimeinstall-x64.exe) <br/> [Installer (x86)](https://aka.ms/windowsappsdk/1.8/1.8.250907003/windowsappruntimeinstall-x86.exe) <br/> [Installer (arm64)](https://aka.ms/windowsappsdk/1.8/1.8.250907003/windowsappruntimeinstall-arm64.exe) <br/> [Redistributable](https://aka.ms/windowsappsdk/1.8/1.8.250907003/Microsoft.WindowsAppRuntime.Redist.1.8.zip) |
2829

0 commit comments

Comments
 (0)