如何将我的协议添加到 windows 10 中的默认程序中?

How to add my protocol into default programs in windows 10?

您好,我有一个新协议 URL:myTest,如何将它添加到 windows10 中,以便在默认程序中看到它?我应该在注册表中添加它吗? How/Where 我真的可以那样做吗?

我想将程序与此协议相关联。

"Default Programs" 的注册在 SOFTWARE\RegisteredApplications. If your application fits one of the client types 下的注册表中,那么您应该将 RegisteredApplications 值指向 Software\Clients\%ClientType%\%YourCanonicalName%\Capabilities,否则您可以使用任何键,例如 Software\%YourCompany%\%YourApp%\CapabilitiesSoftware\Classes\Applications\%Filename%\Capabilities.

您的案例中最重要的子项是 UrlAssociations

您还必须在 the normal way 中注册您的协议。

其中一些 changed in Windows 10 我建议您也对 Windows 7 或 8 进行测试。 "Default Programs" 已在 Windows 10.

中弃用

您还应该在 Applications key 中注册自己,以便与 "Open with" 对话框集成。

这是纯桌面应用程序的工作方式,我不确定如果将桌面应用程序转换为 UWP 会发生什么。清单中的现代应用 declare their protocol