Choose your app platform
When you want to create a new desktop application for Windows PCs, the first decision you make is which application platform to use. Windows provides four main application platforms, each with different strengths:
- Universal Windows Platform (UWP): This platform provides a common type system, APIs, and application model for all devices that run Windows 10. UWP applications can be native or managed.
- WPF and Windows Forms: These .NET-based platforms provide a common type system, APIs, and application model for managed applications.
- Win32: This is the original platform for native C/C++ Windows applications that require direct access to Windows and hardware. This makes the Win32 API the platform of choice for applications that need the highest level of performance and direct access to system hardware.
Each of these platforms include a complete UI framework and set of UI controls that let you create desktop apps like Word, Excel, and Photoshop that run in the classic Windows desktop and take full advantage of that environment's specific features. On Windows 10, each these platforms also support using the Windows UI (WinUI) Library to create their user interfaces.
Some of these platforms share some traits and are better suited for certain types of applications. For example, both UWP and .NET have deep integration with Visual Studio. This provides many benefits, especially in the areas of developer productivity, sophisticated and customizable UI, and application security. Because these frameworks support visual designers and UI markup for rapidly creating UI, they are particularly well-suited for line-of-business applications.
No matter which app platform you choose, you can use many Windows 10 features to deliver a modern experience in your app. For example, even if your desktop app is built using WPF, Windows Forms, or the Win32 API, you can still use MSIX package deployment. For more information about all the ways to modernize your desktop apps, see Modernize your desktop apps.
UWP is the leading-edge platform for Windows 10 applications and games. It's a highly customizable platform that uses XAML markup to separate UI (presentation) from code (business logic). UWP is suitable for desktop applications that require a sophisticated UI, styles customization, and graphics-intensive scenarios. UWP also has built-in support for the Fluent Design System for the default UX experience and provides access to the Windows Runtime (WinRT) APIs. By adopting Fluent, UWP automatically supports common input methods such as ink, touch, gamepad, keyboard, and mouse.
Not only can you use UWP to create desktop applications for Windows PCs, but UWP is also the only supported platform for Xbox, HoloLens, and Surface Hub applications. UWP is our newest, leading-edge application platform.
For more information about UWP, see the following articles:
WPF is the established platform for managed Windows applications with access to .NET Core or the full .NET Framework, and it also uses XAML markup to separate UI from code. This platform is designed for desktop applications that require a sophisticated UI, styles customization, and graphics-intensive scenarios. WPF development skills are similar to UWP development skills, so migration from WPF to UWP apps is easier than migration from Windows Forms.
For more information about WPF, see the following articles:
- Getting started (WPF)
- Project templates
- Create your first app (.NET Core)
- Create your first app (.NET Framework)
- Migrate WPF apps to .NET Core
- API reference (.NET)
Windows Forms is the original platform for managed Windows applications with a lightweight UI model and access to .NET Core or the full .NET Framework. It excels at enabling developers to quickly get started building applications, even for developers new to the platform. This is a forms-based, rapid application development platform with a large built-in collection of visual and non-visual drag-and-drop controls. Windows Forms does not use XAML, so deciding later to extend your application to UWP entails a complete re-write of your UI.
For more information about Windows Forms, see the following articles:
- Getting started with Windows Forms
- Project templates
- Create your first Windows Forms app
- Tutorial: Create a picture viewer
- API reference (.NET)
- Enhancing Windows Forms apps
Using the Win32 API with C++ makes it possible to achieve the highest levels of performance and efficiency by taking more control of the target platform with unmanaged code than is possible on a managed runtime environment like WinRT and .NET. However, exercising such a level of control over your application's execution requires greater care and attention to get right, and trades development productivity for runtime performance.
Here are a few highlights of what the Win32 API and C++ offers to enable you to build high-performance applications.
- Hardware-level optimizations, including tight control over resource allocation, object lifetimes, data layout, alignment, byte packing, and more.
- Access to performance-oriented instruction sets like SSE and AVX through intrinsic functions.
- Efficient, type-safe generic programming by using templates.
- Efficient and safe containers and algorithms.
- DirectX, in particular Direct3D and DirectCompute (note that UWP also offers DirectX interop).
For more information, see the following articles:
- Get started
- Project templates
- Create your first Win32 and C++ app
- Technologies and features
- API reference
Windows UI Library
On Windows 10, each of the main desktop platforms also support using the Windows UI (WinUI) Library to create their user interfaces. WinUI started as a toolkit that provided new and updated versions of UWP controls for UWP apps that target down-level versions of Windows 10. WinUI has grown in scope, and is now the modern native user interface (UI) platform for Windows 10 apps across UWP, .NET, and Win32.
You can use WinUI in the following ways in desktop apps:
- UWP apps can use WinUI controls in place of UWP controls provided by the Windows SDK.
- You can update existing WPF, Windows Forms, and C++/Win32 apps to use XAML Islands to host WinUI 2.x controls in the apps.
- Starting with WinUi 3.0, you can create .NET and C++/Win32 apps that use an entirely WinUI-based UI.
Platform comparison: UWP, WPF, and Windows Forms
The following table compares various characteristics of Windows Forms, WPF, and UWP in detail.
|Feature or scenario||UWP||WPF||Windows Forms|
|Supported versions||Windows 10||Windows 7 and later||Windows 7 and later|
|UI runtime||Native (C++/WinRT and C++/CX) and managed (.NET Native)||Managed (.NET Framework and .NET Core 3)||Managed (.NET Framework and .NET Core 3)|
|Open source||Yes (Windows UI Library only)||Yes (.NET Core only)||Yes (.NET Core only)|
|Scenarios that have limited support||
1 We have publicly announced features that will address this scenario in a future release of Windows 10.
2 Although the platform lacks first-class API support for this scenario, developers can support this scenario with workarounds.
Other app platforms
Progressive Web Apps (PWAs)
PWAs let developers package their website code so it can be installed and run like an application on Windows 10 PCs. For more information, see Progressive Web Apps.
Use Xamarin to build cross-platform applications for Windows 10 that can also run on iOS and Android. For more information, see Xamarin.
The Uno Platform enables Windows UWP-based code (C# and XAML) to run on iOS, Android, and WebAssembly. It provides full API definitions for UWP in Windows 10 2004 (19041), and the implementation of parts of the UWP API, such as Windows.UI.Xaml, to enable UWP applications to run on these platforms. For more information, see the Uno Platform docs.