Skip to content

Commit 3bf3738

Browse files
authored
Update information that to pre-release API (#3533)
1 parent a827cfb commit 3bf3738

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

hub/apps/desktop/modernize/apply-rounded-corners.md

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
description: Apply rounded corners in your desktop application.
33
title: Apply rounded corners in desktop apps
44
ms.topic: article
5-
ms.date: 01/28/2022
5+
ms.date: 04/25/2023
66
ms.author: jimwalk
77
author: jwmsft
88
ms.localizationpriority: medium
@@ -15,7 +15,7 @@ Rounded corners are the most immediately noticeable feature of [Windows 11 Geome
1515
> [!NOTE]
1616
> By design, apps are not rounded when maximized, snapped, running in a Virtual Machine (VM), running on a Windows Virtual Desktop (WVD), or running as a Windows Defender Application Guard (WDAG) window.
1717
18-
:::image type="content" source="./images/apply-design/notepad-rounded.png" alt-text="The Notepad app on Windows 11 with rounded corners.":::
18+
:::image type="content" source="./images/apply-design/notepad-rounded.png" alt-text="A screenshot of the Notepad app on Windows 11 with rounded corners.":::
1919

2020
## Why isn't my app rounded?
2121

@@ -44,9 +44,7 @@ If your app's main window doesn't receive automatic rounding, it's because you'v
4444

4545
## How to opt in to rounded corners
4646

47-
### API definition
48-
49-
If your app is not rounded by policy, you can optionally call our new API to allow your app to opt in to rounded corners. This API is expressed as enumeration values to be passed to the [**DwmSetWindowAttribute**](/windows/win32/api/dwmapi/nf-dwmapi-dwmsetwindowattribute) API, as shown in the new **DWM_WINDOW_CORNER_PREFERENCE** enumeration. **DWM_WINDOW_CORNER_PREFERENCE** is defined in the [dwmapi.h header](/windows/win32/api/dwmapi/) and is available in the latest [Insider Preview SDK](https://www.microsoft.com/software-download/windowsinsiderpreviewSDK).
47+
If your app is not rounded by policy, you can optionally use these APIs to let your app opt-in to rounded corners. You specify the corner rounding option you want for your app by passing a value of the [**DWM_WINDOW_CORNER_PREFERENCE**](/windows/win32/api/dwmapi/ne-dwmapi-dwm_window_corner_preference) enumeration (shown in the following table) to the [**DwmSetWindowAttribute**](/windows/win32/api/dwmapi/nf-dwmapi-dwmsetwindowattribute) function.
5048

5149
| Enum value | Description |
5250
| --- | --- |
@@ -55,17 +53,17 @@ If your app is not rounded by policy, you can optionally call our new API to all
5553
| **DWMWCP_ROUND** | Round the corners if appropriate. |
5654
| **DWMWCP_ROUNDSMALL** | Round the corners if appropriate, with a small radius. |
5755

58-
A pointer to the appropriate value from this enum is passed to the third parameter of DwmSetWindowAttribute. For the second parameter, which specifies which attribute you are setting, pass the new **DWMWA_WINDOW_CORNER_PREFERENCE** value defined in the [**DWMWINDOWATTRIBUTE**](/windows/win32/api/dwmapi/ne-dwmapi-dwmwindowattribute) enumeration.
56+
A pointer to the appropriate value from this enum is passed to the third parameter of **DwmSetWindowAttribute**. For the second parameter, which specifies which attribute you are setting, pass the **DWMWA_WINDOW_CORNER_PREFERENCE** value defined in the [**DWMWINDOWATTRIBUTE**](/windows/win32/api/dwmapi/ne-dwmapi-dwmwindowattribute) enumeration.
5957

6058
### For C# apps
6159

62-
DwmSetWindowAttribute is a native Win32 API and is not exposed directly to .NET code. You'll need to use your language's implementation of P/Invoke to declare the function (C# code is given in the example below). All standard WinForms and WPF apps are rounded automatically, but if you customize your window frame or use a third party framework, you might need to opt-in to rounded corners. See the Examples section for further details.
60+
[**DwmSetWindowAttribute**](/windows/win32/api/dwmapi/nf-dwmapi-dwmsetwindowattribute) is a native Win32 API and is not exposed directly to .NET code. You'll need to use your language's implementation of [P/Invoke](/dotnet/standard/native-interop/pinvoke) to declare the function (C# code is given in the example below). All standard WinForms and WPF apps are rounded automatically, but if you customize your window frame or use a third party framework, you might need to opt-in to rounded corners. See the Examples section for further details.
6361

6462
## Examples
6563

6664
The following examples show how you can call [**DwmSetWindowAttribute**](/windows/win32/api/dwmapi/nf-dwmapi-dwmsetwindowattribute) or [**DwmGetWindowAttribute**](/windows/win32/api/dwmapi/nf-dwmapi-dwmgetwindowattribute) to control your app's rounding experience if your app is not rounded by policy.
6765

68-
> [!Note]
66+
> [!NOTE]
6967
> Error handling has been left out of these examples for brevity and clarity.
7068
7169
### Example 1 - Rounding an app's main window in C# - WPF

0 commit comments

Comments
 (0)