アプリ プラットフォームの選択Choose your app platform
Windows PC 用の新しいデスクトップ アプリケーションを作成する場合は、まず、どのアプリケーション プラットフォームを使用するかを決定します。When you want to create a new desktop application for Windows PCs, the first decision you make is which application platform to use. Windows には、次の 4 つの主要なアプリケーション プラットフォームが用意されており、それぞれに長所があります。Windows provides four main application platforms, each with different strengths:
- ユニバーサル Windows プラットフォーム (UWP)Universal Windows Platform (UWP)
- WPF (.NET)WPF (.NET)
- Windows フォーム (.NET)Windows Forms (.NET)
- Win32Win32
これらのアプリケーション プラットフォームでは、従来の Windows デスクトップで実行される Word、Excel、Photoshop などのデスクトップ アプリを作成し、その環境固有の機能を最大限に活用することができます。All of these application platforms 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. ただし、これらのプラットフォームの一部はいくつかの特徴を共有し、特定の種類のアプリケーションにより適しています。However, some of these platforms share some traits and are better suited for certain types of applications:
UWP、WPF、Windows フォーム。UWP, WPF, and Windows Forms. これらのプラットフォームは、特に開発者の生産性、洗練されたカスタマイズ可能な UI、アプリケーションのセキュリティの領域において、マネージド ランタイム環境 (UWP 用の Windows ランタイムと、Windows フォームと WPF 用の .NET) を提供します。These platforms provide managed runtime environments (the Windows Runtime for UWP, and .NET for Windows Forms and WPF) with many benefits, especially in the areas of developer productivity, sophisticated and customizable UI, and application security. これらのフレームワークは、UI を迅速に作成するためのビジュアル デザイナーと UI マークアップをサポートしているため、基幹業務アプリケーションに特に適しています。Because these frameworks support visual designers and UI markup for rapidly creating UI, they are particularly well-suited for line-of-business applications.
Win32 API。Win32 API. WIN32 API (Windows API とも呼ばれます) は、Windows とハードウェアへの直接アクセスを必要とするネイティブ C/C++ の Windows アプリケーションのために用意された最初のプラットフォームです。The Win32 API (also called the Windows API) is the original platform for native C/C++ Windows applications that require direct access to Windows and hardware. .NET や WinRT などのマネージド ランタイム環境に依存することなく、最上級の開発環境を提供します。It provides a first-class development experience without depending on a managed runtime environment like .NET and WinRT. これにより、Win32 API 最高レベルのパフォーマンスとシステム ハードウェアへの直接アクセスを必要とするアプリケーションに適したプラットフォームになっています。This makes the Win32 API the platform of choice for applications that need the highest level of performance and direct access to system hardware.
この記事は、これらのプラットフォームについて詳しく説明し、アプリケーションに最適なプラットフォームを決定するのに役立ちます。This article describes these platforms in more detail and helps you determine the best one for your application.
注意
どのアプリ プラットフォームを選択しても、ユニバーサル Windows プラットフォーム (UWP) の多くの機能を使用して、Windows 10 でアプリの最新のエクスペリエンスを提供できます。No matter which app platform you choose, you can use many features of the Universal Windows Platform (UWP) to deliver a modern experience in your app on Windows 10. たとえば、デスクトップ アプリが WPF、Windows フォーム、または Win32 API を使用して構築されている場合でも、MSIX パッケージの展開や UWP XAML コントロールなど、UWP で初めて導入された多くの機能を使用できます。For example, even if your desktop app is built using WPF, Windows Forms, or the Win32 API, you can still use many features first introduced with UWP, such as MSIX package deployment and UWP XAML controls. 詳しくは、「デスクトップ アプリの現代化」を参照してください。For more information, see Modernize your desktop apps.
UWPUWP
UWP は、Windows 10 アプリケーションおよびゲーム用の最先端のプラットフォームです。UWP is the leading-edge platform for Windows 10 applications and games. XAML マークアップを使用してコード (ビジネス ロジック) から UI (プレゼンテーション) を分離する、高度にカスタマイズ可能なプラットフォームです。It's a highly customizable platform that uses XAML markup to separate UI (presentation) from code (business logic). UWP は、高度な UI、スタイルのカスタマイズ、およびグラフィックス集中型のシナリオを必要とするデスクトップ アプリケーションに適しています。UWP is suitable for desktop applications that require a sophisticated UI, styles customization, and graphics-intensive scenarios. また、UWP には、既定の UX エクスペリエンスのための Fluent Design System の組み込みサポートもあり、Windows ランタイム (WinRT) API へのアクセスを提供します。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. Fluent を導入することにより、UWP では一般的な入力方式 (インク、タッチ、ゲームパッド、キーボード、マウスなど) が自動的にサポートされます。By adopting Fluent, UWP automatically supports common input methods such as ink, touch, gamepad, keyboard, and mouse.
UWP は、Windows PC 用のデスクトップ アプリケーションを作成できるだけでなく、Xbox、HoloLens、および Surface Hub アプリケーションで唯一サポートされているプラットフォームでもあります。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 は最新で最先端のアプリケーション プラットフォームです。UWP is our newest, leading-edge application platform.
UWP の詳細については、次の記事を参照してください。For more information about UWP, see the following articles:
- 作業の開始Get started
- 設計と UIDesign and UI
- テクノロジと機能Technologies and features
- API リファレンスAPI reference
- サンプルSamples
WPFWPF
WPF は、.NET Core にアクセスできるか、.NET Framework にフル アクセスできるマネージド Windows アプリケーション用に確立されたプラットフォームであり、XAML マークアップを使用してコードから UI を分離します。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. このプラットフォームは、高度な UI、スタイルのカスタマイズ、およびグラフィックス集中型のシナリオを必要とするデスクトップ アプリケーションのために設計されています。This platform is designed for desktop applications that require a sophisticated UI, styles customization, and graphics-intensive scenarios. WPF の開発スキルは UWP の開発スキルに似ているため、WPF から UWP アプリへの移行は Windows フォームからの移行よりも簡単です。WPF development skills are similar to UWP development skills, so migration from WPF to UWP apps is easier than migration from Windows Forms.
WPF の詳細については、次の記事を参照してください。For more information about WPF, see the following articles:
- 使ってみる (WPF)。Getting started (WPF).
- 初めてのアプリの作成 (.NET Core)Create your first app (.NET Core)
- 初めてのアプリの作成 (.NET Framework)Create your first app (.NET Framework)
- WPF アプリを .NET Core に移行するMigrate WPF apps to .NET Core
- API リファレンス (.NET)API reference (.NET)
- サンプルSamples
Windows フォームWindows Forms
Windows フォームは、軽量 UI モデルや、.NET Core へのアクセスと .NET Framework へのフル アクセスを備え、Windows マネージド アプリケーションのために用意された最初のプラットフォームです。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 フォームでは XAML を使用しないため、後でアプリケーションを UWP に拡張する場合は、UI を完全に再記述する必要があります。Windows Forms does not use XAML, so deciding later to extend your application to UWP entails a complete re-write of your UI.
Windows フォームの詳細については、次の記事を参照してください。For more information about Windows Forms, see the following articles:
- Windows フォームについてGetting started with Windows Forms
- 初めての Windows フォーム アプリの作成Create your first Windows Forms app
- チュートリアル: ピクチャ ビューアーの作成Tutorial: Create a picture viewer
- API リファレンス (.NET)API reference (.NET)
- Windows フォーム アプリの拡張Enhancing Windows Forms apps
Win32Win32
C++ で Win32 API を使用すると、WinRT や .NET などのマネージド ランタイム環境以上のターゲット プラットフォームの制御の強化をアンマネージド コードを使用して行うことで、最高レベルのパフォーマンスと効率を実現できます。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.
ここでは、高パフォーマンスのアプリケーションの構築を可能にする、Win32 API と C++ が提供するものについて説明します。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.
- 組み込み関数による SSE や AVX などのパフォーマンス指向の命令セットへのアクセス。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、特に Direct3D および DirectCompute (UWP は DirectX 相互運用機能も提供)。DirectX, in particular Direct3D and DirectCompute (note that UWP also offers DirectX interop).
詳しくは、次の記事をご覧ください。For more information, see the following articles:
- 作業の開始Get started
- 初めての Win32 および C++ アプリの作成Create your first Win32 and C++ app
- テクノロジと機能Technologies and features
- API リファレンスAPI reference
- サンプルSamples
プラットフォームの比較:UWP、WPF、Windows フォームPlatform comparison: UWP, WPF, and Windows Forms
次の表は、Windows フォーム、WPF、UWP のさまざまな特性を詳細に比較したものです。The following table compares various characteristics of Windows Forms, WPF, and UWP in detail.
機能またはシナリオFeature or scenario | UWPUWP | WPFWPF | Windows フォームWindows Forms | |
---|---|---|---|---|
サポートされているバージョンSupported versions | Windows 10Windows 10 | Windows 7 以降Windows 7 and later | Windows 7 以降Windows 7 and later | |
言語Languages | C#、 C++/WinRT、 C++/CX、VB、JavaScriptC#, C++/WinRT, C++/CX, VB, JavaScript | C#、 C++/CLI (C++ マネージド拡張)、F#、VBC#, C++/CLI (Managed Extensions for C++), F#, VB | C#、 C++/CLI (C++ マネージド拡張)、F#、VBC#, C++/CLI (Managed Extensions for C++), F#, VB | |
UI ランタイムUI runtime | ネイティブ (C++WinRT および C++/CX) とマネージド (.NET ネイティブ)Native (C++/WinRT and C++/CX) and managed (.NET Native) | マネージド (.NET Framework および .NET Core 3)Managed (.NET Framework and .NET Core 3) | マネージド (.NET Framework および .NET Core 3)Managed (.NET Framework and .NET Core 3) | |
オープン ソースOpen source | はい (Windows UI ライブラリのみ)Yes (Windows UI Library only) | はい (.NET Core のみ)Yes (.NET Core only) | はい (.NET Core のみ)Yes (.NET Core only) | |
XAML をサポートSupports XAML | 〇Yes | 〇Yes | XNo | |
特長Strengths |
|
|
|
|
サポートが限定されているシナリオScenarios that have limited support |
|
|
|
1 Windows 10 の今後のリリースでこのシナリオに対処する機能が公開されています。1 We have publicly announced features that will address this scenario in a future release of Windows 10.
2 プラットフォームには、このシナリオに対する最上級の API のサポートがありませんが、開発者はこのシナリオを回避策によりサポートできます。2 Although the platform lacks first-class API support for this scenario, developers can support this scenario with workarounds.
その他のアプリ プラットフォームOther app platforms
プログレッシブ Web アプリ (PWA)Progressive Web Apps (PWAs)
PWA により、開発者は Web サイト コードをパッケージ化し、Windows 10 の PC 上のアプリケーションのようにインストールして実行できるようになります。PWAs let developers package their website code so it can be installed and run like an application on Windows 10 PCs. 詳細については、プログレッシブ Web アプリに関する記事を参照してください。For more information, see Progressive Web Apps.
XamarinXamarin
Xamarin は、Windows 10 用でありながら iOS および Android でも実行できるクロスプラットフォーム アプリケーションの作成に使用します。Use Xamarin to build cross-platform applications for Windows 10 that can also run on iOS and Android. 詳細については、Xamarinに関する記事を参照してください。For more information, see Xamarin.