Building windows desktop applications

Создание классических приложений для компьютеров с Windows Build desktop apps for Windows PCs

Эта статья содержит сведения, необходимые, чтобы приступить к созданию классических приложений для Windows или обновления существующих классических приложений для использования новейших возможностей Windows 10 This article provides the info you need to get started building desktop apps for Windows or updating existing desktop apps to adopt the latest experiences in Windows 10.

Платформы для классических приложений Platforms for desktop apps

Существуют четыре основные платформы для создания классических приложений для компьютеров с Windows. There are four main platforms for building desktop apps for Windows PCs. Каждая платформа предоставляет модель приложения, определяющую жизненный цикл приложения, полную инфраструктуру пользовательского интерфейса и набор элементов управления пользовательского интерфейса, которые позволяют создавать классические приложения, такие как Word, Excel и Photoshop, и получать доступ к исчерпывающему набору управляемых или собственных API-интерфейсов для использования функций Windows. Each platform provides an app model that defines the lifecycle of the app, a complete UI framework and set of UI controls that let you create desktop apps like Word, Excel, and Photoshop, and access to a comprehensive set of managed or native APIs for using Windows features.

Подробное сравнение этих платформ и дополнительные материалы по каждой платформе доступны в разделе Выбор платформы для приложения. For an in-depth comparison of these platforms along with additional resources for each platform, see Choose your app platform.

Передовая платформа для приложений и игр для, предназначенных для Windows 10. The leading-edge platform for Windows 10 apps and games. Вы можете создавать приложения UWP, которые используют только элементы управления и интерфейсы API универсальной платформы Windows (UWP), или использовать эти элементы управления и API в классических приложениях, созданных с помощью одной из других платформ. You can build UWP apps that exclusively use UWP controls and APIs, or you can use UWP controls and APIs in desktop apps that are built using one of the other platforms.

Предпочтительная платформа для собственных приложений для Windows, которым требуется прямой доступ к Windows и оборудованию. The platform of choice for native Windows apps that require direct access to Windows and hardware.

Общепризнанная платформа на основе .NET для преимущественно графических приложений для Windows, использующих модель пользовательского интерфейса XAML. The established .NET-based platform for graphically-rich managed Windows apps with a XAML UI model. Эти приложения могут быть нацелены на .NET Core 3 или полную платформу .NET Framework. These apps can target .NET Core 3 or the full .NET Framework.

Платформа на основе .NET, предназначенная для управляемых бизнес-приложений, использующих упрощенную модель пользовательского интерфейса. A .NET-based platform that is designed for managed line-of-business apps with a lightweight UI model. Эти приложения могут быть нацелены на .NET Core 3 или полную платформу .NET Framework. These apps can target .NET Core 3 or the full .NET Framework.

Стратегия развития Future roadmap

В будущем мы планируем улучшать платформы разработки приложений для Windows с помощью библиотеки пользовательского интерфейса Windows (WinUI) и Project Reunion. Looking forward, we are evolving the Windows app development platforms with the Windows UI Library (WinUI) and Project Reunion.

WinUI — это собственная среда взаимодействия с пользователем для приложений Windows 10. WinUI is a native user experience (UX) framework for Windows 10 apps. Библиотека WinUI разрабатывалась как набор средств. Она предоставляла новые и обновленные версии элементов управления WinRT для приложений UWP, предназначенных для более ранних версий Windows 10. WinUI started as a toolkit that provides new and updated versions of WinRT controls for UWP apps that target down-level versions of Windows 10. Область действия WinUI расширилась, и WinUI 3 представляет собой современную нативную платформу пользовательского интерфейса для приложений Windows 10 в UWP, .NET и Win32. As of WinUI 3, WinUI is growing in scope to become the premier native user interface (UI) framework for Windows 10 apps across UWP, .NET, and Win32 app platforms.

Project Reunion — это кодовое название для широкого спектра новых компонентов и инструментов для разработчиков. Это новый этап развития платформы для разработки приложений Windows. Project Reunion is the code name for a broad set of new developer components and tools that represents the next evolution in the Windows app development platform. Project Reunion включает единый набор API и инструментов, которые могут согласованно использоваться любыми приложениями в различных целевых версиях ОС Windows 10. Project Reunion provides a unified set of APIs and tools that can be used in a consistent way by any app on a broad set of target Windows 10 OS versions. Project Reunion дополняет имеющиеся платформы и среды приложений Windows, такие как UWP, нативная среда Win32 и .NET, общим набором API и инструментов, которые упрощают работу разработчиков. Project Reunion complements existing Windows app platforms and frameworks such as UWP and native Win32, and .NET with a common set of APIs and tools that developers can rely on across these platforms.

Дополнительные сведения см. в статье Project Reunion. For more information, see Project Reunion.

Обновление существующих классических приложений для Windows 10 Update existing desktop apps for Windows 10

Если у вас есть классические приложения WPF, Windows Forms или собственные классические приложения Win32, в Windows 10 и универсальной платформе Windows (UWP) предлагается много возможностей для реализации современных функций в имеющихся приложениях. If you have an existing WPF, Windows Forms, or native Win32 desktop app, Windows 10 and the Universal Windows Platform (UWP) offer many features you can use to deliver a modern experience in your app. Большинство этих функций доступны в виде модульных компонентов, которые можно внедрить в приложение в своем собственном темпе, не переписывая код приложения для другой платформы. Most of these features are available as modular components that you can adopt in your app at your own pace without having to rewrite your app for a different platform.

Ниже приведено лишь несколько функций, позволяющих улучшить существующие классические приложения. Here are just a few of the features available to enhance your existing desktop apps:

  • Используйте MSIX для упаковки и развертывания классических приложений. Use MSIX to package and deploy your desktop apps. MSIX — это современный формат пакета приложения для Windows, позволяющий упаковывать любые приложения для Windows. MSIX is a modern Windows app package format that provides a universal packaging experience for all Windows apps. Этот безопасный и надежный формат упаковки сочетает в себе преимущества технологий установки с использованием MSI-файлов, APPX-файлов, App-V и ClickOnce. MSIX brings together the best aspects of MSI, .appx, App-V and ClickOnce installation technologies and is built to be safe, secure, and reliable.
  • Интегрируйте возможности Windows 10 в свое классическое приложение с помощью расширений пакетов. Integrate your desktop app with Windows 10 experiences by using package extensions. Например, закрепите свое приложение в меню «Пуск», предоставьте к нему общий доступ или отправляйте всплывающие уведомления из приложения. For example, point Start tiles to your app, make your app a share target, or send toast notifications from your app.
  • Используйте острова XAML для размещения элементов управления XAML UWP в своем классическом приложении. Use XAML Islands to host UWP XAML controls in your desktop app. Многие последние функции пользовательского интерфейса Windows 10 доступны только для элементов управления XAML UWP. Many of the latest Windows 10 UI features are only available to UWP XAML controls.

Дополнительные сведения доступны в приведенных ниже статьях. For more information, see these articles.

Платформа Platform Описание Description Документация и ресурсы Docs and resources
Универсальная платформа Windows (UWP) Universal Windows Platform (UWP)
Статья Article Описание Description
Модернизация классических приложений Modernize desktop apps Описываются последние возможности разработки для Windows 10 и UWP, которые можно использовать в любом классическом приложении, включая приложения WPF, Windows Forms и приложения Win32 на C++. Describes the latest Windows 10 and UWP development features you can use in any desktop app, including WPF, Windows Forms, and C++ Win32 apps.
Руководство. Модернизация приложения WPF Tutorial: Modernize a WPF app Следуйте пошаговым инструкциям, чтобы модернизировать существующий пример бизнес-приложения WPF, добавив элементы управления рукописным вводом и календарем UWP в приложение и упаковав его в пакет MSIX. Follow step-by-step instructions to modernize an existing WPF line-of-business sample app by adding UWP Ink and calendar controls to the app and packaging it in an MSIX package.

Создание классических приложений Create new desktop apps

Ниже приведены некоторые ресурсы, которые помогут вам приступить к созданию классического приложения для Windows. If you are creating a new desktop app for Windows, here are some resources to help get you started.

Modernize your desktop apps

Windows 10 and the Universal Windows Platform (UWP) offer many features you can use to deliver a modern experience in your desktop apps. Most of these features are available as modular components that you can adopt in your desktop apps at your own pace without having to rewrite your application for a different platform. You can enhance your existing desktop apps by choosing which parts of Windows 10 and UWP to adopt.

This article describes the Windows 10 and UWP features that you can use in your desktop apps today. For a tutorial that demonstrates how to modernize an existing app to use many of the features described in this article, see the Modernize a WPF app tutorial.

Do you need assistance migrating desktop apps to Windows 10? The Desktop App Assure service provides direct, no-cost support to developers who are porting their apps to Windows 10. This program is available to all ISVs and eligible enterprises. For more details on eligibility and about the program itself, visit /fasttrack/win-10-app-assure-assistance-offered. To get started now, submit your request.

Windows UI Library

The Windows UI Library is a set of NuGet packages that provide controls and other user interface elements for Windows 10 apps. WinUI started as a toolkit that provided new and updated versions of WinRT XAML 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 native Win32.

You can use WinUI in the following ways in desktop apps:

  • You can update existing WPF, Windows Forms, and C++/Win32 apps with XAML Islands and host WinUI 2.x controls.
  • Use WinUI 3 to create managed C#/.NET 5 and native C++/Win32 desktop apps with an entirely WinUI-based user interface.

MSIX packages

MSIX is a modern Windows app package format that provides a universal packaging experience for all Windows apps, including UWP, WPF, Windows Forms and Win32 apps. MSIX brings together the best aspects of MSI, .appx, App-V and ClickOnce installation technologies to provide a modern and reliable packaging experience.

Packaging your desktop Windows apps in MSIX packages gets you access to a robust installation and updating experience, a managed security model with a flexible capability system, support for the Microsoft Store, enterprise management, and many custom distribution models.

For more information, see Package desktop applications in the MSIX documentation.

.NET Core 3

.NET Core 3 is the latest major release of .NET Core. The highlight of this release is support for Windows desktop apps, including Windows Forms and WPF apps. You can run new and existing Windows desktop apps on .NET Core 3 and enjoy all the benefits that .NET Core has to offer. WinRT XAML controls that are hosted in XAML Islands can also be used in Windows Forms and WPF apps that target .NET Core 3.

Windows Runtime APIs

You can call many Windows Runtime APIs directly in your WPF, Windows Forms, or C++ Win32 desktop app to integrate modern experiences that light up for Windows 10 users. For example, you can call Windows Runtime APIs to add toast notifications to your desktop app.

Host WinRT XAML controls (XAML Islands)

Starting with the Windows 10, version 1903, you can add UWP XAML controls directly to any UI element in a WPF, Windows Forms, or C++ Win32 app that is associated with a window handle (HWND). This means that you can fully integrate the latest UWP features such as Windows Ink and controls that support the Fluent Design System into windows and other display surfaces in your desktop apps. This developer scenario is sometimes called XAML islands.

Use the Visual layer in desktop apps

You can now use Windows Runtime APIs in non-UWP desktop apps to enhance the look, feel, and functionality of your WPF, Windows Forms, and C++ Win32 apps, and take advantage of the latest Windows 10 UI features that are only available via UWP. This is useful when you need to create custom experiences that go beyond the built-in WinRT XAML controls you can host by using XAML Islands.

Additional features available to apps with package identity

Some modern Windows 10 experiences are available only in desktop apps that have package identity. These features include certain Windows Runtime APIs, package extensions, and UWP components. For more information, see Features that require package identity.

There are several ways to grant identity to a desktop app:

  • Package it in an MSIX package. MSIX is a modern app package format that provides a universal packaging experience for all Windows apps, WPF, Windows Forms and Win32 apps. It provides a robust installation and updating experience, a managed security model with a flexible capability system, support for the Microsoft Store, enterprise management, and many custom distribution models. For more information, see Package desktop applications in the MSIX documentation.
  • If you are unable to adopt MSIX packaging for deploying your desktop app, starting in Windows 10, version 2004, you can grant package identity by creating a sparse MSIX package that contains only a package manifest. For more information, see Grant identity to non-packaged desktop apps.

WinRT XAML controls optimized for desktop apps

Whether you’re building a UWP app that exclusively targets the desktop device family or you want to use WinRT XAML controls in a WPF, Windows Forms, or C++ Win32 desktop app, the following new and updated WinRT XAML controls are designed to offer desktop-optimized experiences with the Fluent Design System. These controls were introduced in Windows 10, version 1809 (the October 2018 Update, or version 10.0.17763).

Control Description
MenuBar Provides a quick and simple way to expose a set of commands for apps that might need more organization or grouping than a CommandBar allows.
DropDownButton Shows a chevron as a visual indicator that it has an attached flyout that contains more options.
SplitButton Provides a button has two parts that can be invoked separately. One part behaves like a standard button and invokes an immediate action. The other part invokes a flyout that contains additional options that the user can choose from.
ToggleSplitButton Provides a button has two parts that can be invoked separately. One part behaves like a toggle button that can be on or off. The other part invokes a flyout that contains additional options that the user can choose from.
CommandBarFlyout Lets you show common user tasks in the context of an item on your UI canvas.
ComboBox You can now make a combo box editable so the user can enter values that aren’t listed in the control.
TreeView You can now configure a tree view to enable data binding, item templates, and drag and drop.
DataGridView Provides a flexible way to display a collection of data in rows and columns. This control is available in the Windows Community Toolkit.

Other technologies for modern desktop apps

Microsoft Graph

Microsoft Graph is a collection of APIs you can use to build apps for organizations and consumers that interact with the data of millions of users. Microsoft Graph exposes REST APIs and client libraries to access data on the following:

  • Azure Active Directory
  • Microsoft 365 Office apps: SharePoint, OneDrive, Outlook/Exchange, Microsoft Teams, OneNote, Planner, and Excel
  • Enterprise Mobility and Security services: Identity Manager, Intune, Advanced Threat Analytics, and Advanced Threat Protection.
  • Windows 10 services: activities and devices

For more information, see the Microsoft Graph docs.

Adaptive Cards

Adaptive Cards is an open, cross-platform framework that you can use to exchange card-based UI content in a common and consistent way across devices and platforms.

For more information, see the Adaptive Cards docs.

Читайте также:  Интегрировать драйвера дистрибутив windows server
Оцените статью