windows - 为什么说 WinRT 取代了 Windows API

标签 windows api winapi windows-runtime desktop-bridge

在几乎所有关于新 WinRT API 的文章中,我都提到了诸如“WinRT 是适用于 Windows 的新 API 并取代了旧的 Win32 API”之类的陈述。由于 WinRT 的目标是开发 Windows 应用商店应用程序,因此对我来说,这种说法似乎并不成立。

我无法想象有很多应用程序可以用 WinRT 完成(例如 Microsoft Office、Adobe 产品、3D 设计器程序甚至 Visual Studio)。这些应用程序仍然需要 Windows API(也称为 Win32)的功能。

那么为什么经常有人说 WinRT API 取代了 Windows API?

最佳答案

最近由于几个原因,这种情况有所改变,但以下是您希望在当前 Windows 应用程序开发(大约 2017 年)中使用 WinRT 而不是 Win32 的原因的简要说明:

  1. UWP 应用利用 WinRT
  2. 可以使用 Desktop Bridge 将 Win32 应用程序转换为 UWP 应用程序
  3. Windows 10 S requires all apps to go through the Windows Store

enter image description here

因此,使用 WinRT 将调用更少的时间来转换新的 Windows 10 S Store-only 应用程序范例的项目和代码。

关于 WinRT 与 Win32API 与 .NET 的比较,.NET 和 WinRT 都是部分使用 Win32 构建的; IIRC,他们使用它的子集。至少这是 2012 年 ArsTechnica 在 Peter Bright 的文章 "Turning to the past to power Windows’ future: An in-depth look at WinRT" 中传达的内容。 .这就是这个堆栈图的来源,或者至少它在那里使用:

enter image description here

关于windows - 为什么说 WinRT 取代了 Windows API,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31273757/

相关文章:

windows - 寻找 Forms.Screen.DeviceName 的可靠映射以监控 EDID 信息

c# - 在表插入上显示窗口气球通知

api - 从带有特定标签的 repo 中获取所有 Github 问题?

angular - Angular 中的 Tableau 集成不起作用

winapi - GetTimeZoneInformation 的返回值对于动态 DST 区域也有效吗?

windows - 如何使用批处理文件验证 Windows 服务是否已安装并正在运行

windows - 线程 "main"com.jacob.com.ComFailException : Can't co-create object 中的异常

angularjs - 使用 Angular ngResource 自定义 URL

winapi - 在 Windows Server 2019 上从作为 IIS APPPOOL 帐户运行的进程调用 OpenProcess 的访问被拒绝

winapi - Windows wchar_t如何处理基本多语言平面之外的Unicode字符?