创建在 Vista/Win7 “默认程序” 中可显示的程序

来源:互联网 发布:适合c语言的编译器 编辑:程序博客网 时间:2024/04/26 14:01


在 Vista / Win7 中,有下面这个东东:



那么,这里面的程序是怎么出来的呢?Windows 是依据什么只显示这几个,不显示我们开发的程序呢?


答案在这里:[HKEY_LOCAL_MACHINE\SOFTWARE\RegisteredApplications]

必须在这里注册一下,例如:

Windows Registry Editor Version 5.00[HKEY_LOCAL_MACHINE\SOFTWARE\RegisteredApplications]"Windows Address Book"="Software\\Clients\\Contacts\\Address Book\\Capabilities""Windows Media Player"="Software\\Clients\\Media\\Windows Media Player\\Capabilities""Wordpad"="Software\\Microsoft\\Windows\\CurrentVersion\\Applets\\Wordpad\\Capabilities""Internet Explorer"="SOFTWARE\\Microsoft\\Internet Explorer\\Capabilities""WinRAR"="Software\\WinRAR\\Capabilities"

然后创建对应的注册表路径,例如:

Windows Registry Editor Version 5.00[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\Capabilities]"ApplicationDescription"=hex(2):40,00,43,00,3a,00,5c,00,50,00,72,00,6f,00,67,\  00,72,00,61,00,6d,00,20,00,46,00,69,00,6c,00,65,00,73,00,5c,00,49,00,6e,00,\  74,00,65,00,72,00,6e,00,65,00,74,00,20,00,45,00,78,00,70,00,6c,00,6f,00,72,\  00,65,00,72,00,5c,00,69,00,65,00,78,00,70,00,6c,00,6f,00,72,00,65,00,2e,00,\  65,00,78,00,65,00,2c,00,2d,00,37,00,30,00,36,00,00,00"ApplicationName"=hex(2):40,00,25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,\  6f,00,6f,00,74,00,25,00,5c,00,53,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,\  00,5c,00,69,00,73,00,6f,00,62,00,75,00,72,00,6e,00,2e,00,65,00,78,00,65,00,\  2c,00,2d,00,33,00,35,00,32,00,00,00[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\Capabilities\FileAssociations]".html"="IE.AssocFile.HTM"".htm"="IE.AssocFile.HTM"[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\Capabilities\MIMEAssociations]"message/rfc822"="IE.message/rfc822""text/html"="IE.text/html"[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\Capabilities\Startmenu]"StartmenuInternet"="IEXPLORE.EXE"[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\Capabilities\UrlAssociations]"https"="IE.HTTPS""ftp"="IE.FTP""http"="IE.HTTP"

需要注意的是:

ApplicationDescription 和 ApplicationName 是可选的,类型为可扩展字符串(REG_EXPAND_SZ),值可使用 @ 来代替,例如

@%SystemRoot%\System32\isoburn.exe,-352

至于  FileAssociations、MIMEAssociations、Startmenu、UrlAssociations,根据自己的需要定制就可以了。