UWP与Win32程序区别

发布于 2020-11-08  421 次阅读


1 权限

UWP程序运行在app container环境之内,在VS中对应的属性为link中的
/APPCONTAINER,其他程序是不运行在app container中的。

UWP程序 app container 属性如图:
pic_app_container.png

关于UWP app container 运行环境要求参见
/APPCONTAINER (Microsoft Store App)

其中说到:

This option modifies an executable to indicate whether the app must be run in the appcontainer process-isolation environment. Specify /APPCONTAINER for an app that must run in the appcontainer environment—for example, a Universal Windows Platform (UWP) or Windows Phone 8.x app. (The option is set automatically in Visual Studio when you create a Universal Windows app from a template.)

UWP程序的各种权限要求也来自于app container 环境。

2 UWP中可以调用的Win32 以及 COM 接口有限

UWP中可以调用的Win32以及COM接口有限,开发时请参照微软官方文档的接口列表。
有部分Win32以及COM接口在UWP中提供了替代接口以便使用。

根据微软官方文档,传统的App installation接口在UWP中不再支持,与之替代的参
见:
Windows.ApplicationModel.Package
Windows.Management.Deployment

设备相关的接口已有替代:

featurenamespace
BluetoothWindows.Devices.Bluetooth
Device enumeration (Function Discovery, PnP-X, WSD)Windows.Devices.Enumeration
FAXnone
Location APIWindows.Devices.Geolocation
PrintWindows.Graphics.Printing
3D PrintingWindows.Graphics.Printing3D
SensorsWindows.Devices.Sensors
Serial and parallel portsWindows.Devices.SerialCommunication
SMSWindows.Devices.Sms
UPnPWindows.Devices.Enumeration.Pnp
Windows Portable DevicesWindows.Devices.Portable
WSDWindows.Devices.Enumeration
BatteryWindows.Devices.Power,Windows.System.Power

图像接口如:

  • Direct2D
  • Direct3D 11
  • DirectWrite
  • DirectXMath
  • DXGI
  • WIC

已被UWP相关部分所取代,参见Design,DirectX programming,Direct3D Graphics,
Learning Guide,Graphics and animation

多媒体接口:Core Audio,Media Foundation,Media Playback,WASAPI被UWP的
Video,Audio以及Camera取代。

网络,打印与文档,安全,存储,系统,用户接口等都有UWP的取代接口。


朝闻道,夕死可矣