如何注册自定义程序来处理 Windows 7 上的 mailto 协议 [英] How to register custom program to handle mailto protocol on Windows 7

查看:71
本文介绍了如何注册自定义程序来处理 Windows 7 上的 mailto 协议的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好的,这可能是我的系统有问题,但我很难让 Windows 7 将我的自定义 exe 识别为 mailto 协议的默认处理程序.

OK, it might be a problem with my system but I'm having a very difficult time getting Windows 7 to recognize my custom exe as the default handler of the mailto protocol.

首先,我见过这个:以编程方式使用mailto协议注册Windows程序

接下来,我看到了这些:

Next, I've seen these:

我已经添加了看似合适的注册表项,但每次单击 mailto 链接(无论是在浏览器中还是通过运行窗口)时,Windows Live Mail 仍然出现.我已经为所有用户和当前用户设置了注册表项,但它仍然不起作用.

I've added what seemed the appropriate registry entries but I still get Windows Live Mail coming up every time I click a mailto link (whether in a browser or via the Run window). I've set the registry entries for all users and for the current user, still it doesn't work.

当我转到默认程序"应用程序并向下滚动到 mailto 协议时,我只看到列出了 Outlook 和 Windows Live Mail.我的自定义应用程序甚至没有出现.

When I go to the 'default programs' app and scroll down to the mailto protocol, I only see Outlook and Windows Live Mail listed. My custom app doesn't even appear.

我认为这要么是 Windows 7 的特别之处,要么是我的计算机的问题.

I figure that it's either something special with Windows 7 or it's something with my computer.

我的自定义应用程序是 WinForms .Net 应用程序,但我认为这并不重要.

My custom app is a WinForms .Net app but I don't think that matters.

非常欢迎任何想法.

推荐答案

The way described in the answer which you referenced in your question seems correct way for Windows 7 as for other operation systems.

我假设您使用的是 64 位版本的 Windows 7,并且您的程序是 32 位应用程序.因此,如果您的应用程序写入 HKEY_LOCAL_MACHINE\SOFTWARE\Classes\mailto\shell\open\command 键,它只会修改键 HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Classes\mailto\shell\open\命令 用于 32 位应用程序.您可以在此处此处.

I suppose that you use 64-bit version of Windows 7 and your program is 32-bit application. So if your application write in the HKEY_LOCAL_MACHINE\SOFTWARE\Classes\mailto\shell\open\command key it modifies only the key HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Classes\mailto\shell\open\command used for 32-bit applications. You can read more about registry virtualisation here and here.

如果是您的情况,您可以直接调用本机 Win32 API RegOpenKeyExKEY_WOW64_64KEY 标志,在 32 位操作系统上将被忽略.

If it's your case you can call directly native Win32 API RegOpenKeyEx with the KEY_WOW64_64KEY flag which will be ignored on 32-bit operation system.

这篇关于如何注册自定义程序来处理 Windows 7 上的 mailto 协议的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆