建置 Windows PC 適用的傳統型應用程式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 PC 的傳統型應用程式有四個主要平台。There are four main platforms for building desktop apps for Windows PCs. 每個平台都提供一個應用程式模型,該模型定義應用程式的生命週期、完整 UI 架構、一組 UI 控制項 (可讓您建立像是 Word、Excel 和 Photoshop 的桌面應用程式),以及用來使用 Windows 功能的一組全方位受控或原生 API 的存取權限。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.


平台Platform 說明Description 文件與資源Docs and resources
通用 Windows 平台 (UWP)Universal Windows Platform (UWP)

適用於 Windows 10 應用程式和遊戲的先進平台。The leading-edge platform for Windows 10 apps and games. 您可以建立專門使用 UWP 控制項和 API 的 UWP 應用程式,也可以在使用其他平台之一所建立的傳統型應用程式中使用 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.

開始使用Get started
API 參考API reference
範例Samples
C++/Win32C++/Win32

這是適用於原生 Windows 應用程式的首選平台,該應用程式需要直接存取 Windows 和硬體。The platform of choice for native Windows apps that require direct access to Windows and hardware.

開始使用Get started
API 參考API reference
範例Samples
WPFWPF

已建立以 .NET 為基礎的平台,適用於使用 XAML UI 模型之圖形豐富的受控 Windows 應用程式。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.

開始使用Get started
API 參照 (.NET)API reference (.NET)
範例Samples
Windows FormsWindows Forms

一個以 .NET 為基礎的平台,旨在為具有輕量 UI 模型的受管企業營運應用程式所設計。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.

開始使用Get started
API 參照 (.NET)API reference (.NET)

未來藍圖Future roadmap

未來,我們將使用 Windows UI 程式庫 (WinUI) 和專案留尼旺島來發展 Windows 應用程式開發平臺。Looking forward, we are evolving the Windows app development platforms with the Windows UI Library (WinUI) and Project Reunion.

  • WinUI 是適用於 Windows 10 應用程式的原生使用者體驗 (UX) 架構。WinUI is a native user experience (UX) framework for Windows 10 apps. WinUI 是以工具組的形式開始,為以舊版 Windows 10 為目標的 UWP 應用程式提供新的和更新版本的 WinRT 控制項。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 3 開始,WinUI 的範圍日益成長,成為頂級的原生使用者介面, (UI) 架構,以在 UWP、.NET 和 Win32 應用程式平臺上 Windows 10 應用程式。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.

    如需詳細資訊,請參閱 WINDOWS UI 程式庫 (WinUI) For more information, see Windows UI Library (WinUI).

  • Project 留尼旺島 是一組廣泛的新開發人員元件和工具的程式碼名稱,代表 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 OS 版本上的任何應用程式以一致的方式進行使用。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 會透過一組可讓開發人員在這些平台上仰賴的通用 API 和工具,來與現有的 Windows 應用程式平台和架構 (例如 UWP 和原生 Win32 以及 .NET) 互補。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 ReunionFor 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. MSIX 綜合 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 群島在您的傳統型應用程式中裝載 UWP XAML 控制項。Use XAML Islands to host UWP XAML controls in your desktop app. 許多最新的 Windows 10 UI 功能僅適用於 UWP XAML 控制項。Many of the latest Windows 10 UI features are only available to UWP XAML controls.

如需詳細資訊,請參閱這些主題。For more information, see these articles.


文章Article 說明Description
傳統型應用程式現代化Modernize desktop apps 說明可在任何傳統型應用程式中使用的最新 Windows 10 和 UWP 開發功能,包括 WPF、Windows Forms 和 C++ Win32 應用程式。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 依照逐步指示,將 UWP 筆跡和行事曆控制項新增至應用程式,並將其封裝在 MSIX 套件中,以將現有 WPF 企業營運範例應用程式現代化。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.


文章Article 說明Description
選擇您的應用程式平台Choose your app platform 提供主要傳統型應用程式平台的深入比較,並可協助您選擇適合您需求的平台。Provides an in-depth comparison of the main desktop app platforms and can help you choose the right platform for your needs. 本文也會針對每個平台的文件提供實用的連結。This article also provides useful links to docs for each platform.
適用於 Windows 應用程式的 Visual Studio 專案範本Visual Studio project templates for Windows apps 描述專案和項目範本,Visual Studio 提供這些項目協助您使用 C# 或 C++ 來建置適用於 Windows 10 裝置的應用程式。Describes the project and item templates that Visual Studio provides to help you build apps for Windows 10 devices by using C# or C++.
傳統型應用程式現代化Modernize desktop apps 說明可在任何傳統型應用程式中使用的最新 Windows 10 和 UWP 開發功能,包括 WPF、Windows Forms 和 C++ Win32 應用程式。Describes the latest Windows 10 and UWP development features you can use in any desktop app, including WPF, Windows Forms, and C++ Win32 apps.
功能和技術Features and technologies 提供可透過每個主要傳統型應用程式平台存取的 Windows 功能概觀,並提供相關文件的連結。Provides an overview of Windows features that are accessible via each of the main desktop app platforms and links to the related docs.
資源Resource 描述Description
.NET Core 3.1.NET Core 3.1 深入瞭解 .NET Core 3.1 的最新功能,包括 WPF 和 Windows Forms 應用程式的增強功能。Learn about the latest features of .NET Core 3.1, including enhancements for WPF and Windows Forms apps.
.NET 5.NET 5 本文詳細說明 .NET 5 中包含的內容,這是 3.1 版之後的下一版 .NET Core。This article details what's included in .NET 5, which is the next release of .NET Core following 3.1.
適用於 WPF 和 .NET Core 的桌面指南Desktop guide for WPF and .NET Core 開發以 .NET Core 為目標的 WPF 應用程式,而不是完整的 .NET Framework。Develop WPF apps that target .NET Core instead of the full .NET Framework.
AzureAzure 使用 Azure 雲端服務擴充應用程式的範圍。Extend the reach of your apps with Azure cloud services.
Visual StudioVisual Studio 了解如何使用 Visual Studio 來開發應用程式和服務。Learn how to use Visual Studio to develop apps and services.
MSIXMSIX 以現代化和通用的封裝格式封裝和部署任何 Windows 應用程式。Package and deploy any Windows app in a modern and universal packaging format.
Windows AIWindows AI 使用 Windows AI 針對您應用程式中的複雜問題建立智慧型解決方案。Use Windows AI to build intelligent solutions for complex problems in your apps.
Windows 容器Windows Containers 在快速、完全隔離的 Windows 環境中,將應用程式與相依性封裝在一起。Package your applications with their dependencies in fast, fully isolated Windows environments.
漸進式 Web 應用程式Progressive Web Apps 將您的 Web 應用程式轉換成可在 Windows 10 上以 UWP 應用程式散發和執行的漸進式 Web 應用程式。Convert your web apps into Progressive Web Apps that can be distributed and run as UWP apps on Windows 10.
XamarinXamarin 使用 .NET 程式碼和平台特定的使用者介面,建立適用於 Windows、Android、iOS 和 macOS 的跨平台應用程式。Build cross-platform apps for Windows, Android, iOS, and macOS using .NET code and platform-specific user interfaces.
Windows 8.x 和舊版的文件封存Docs archive for Windows 8.x and earlier 存取為 Windows 8.x 和更早版本建立應用程式的封存文件。Access archived documentation about building apps for Windows 8.x and earlier versions.