創建在 Vista/Win7 “默認程序” 中可顯示的程序


在 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,根據自己的需要定製就可以了。









發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章