如何知道机器里装了几个浏览器?如何设值默认的浏览器?(200分)

  • 主题发起人 主题发起人 panjf
  • 开始时间 开始时间
P

panjf

Unregistered / Unconfirmed
GUEST, unregistred user!
以上的问题要用程序来解决,支持Win9x和2000,xp
 
他们各自在启动时会提示啊。如果将它们设置检查时。
 
设置默认浏览器其实就是写注册表。
 
我是想在我的程序里列出机器上所有可用的浏览器,并可以从中选择一个设为默认的浏览器,
有办法吗?
to yzhshi:
我知道要操作注册表,可要如何做呢?
 
把我的注册表文件导出来给你看看:
Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT/htmlfile/shell]
@="iWander"

[HKEY_CLASSES_ROOT/htmlfile/shell/Edit]
@="编辑(&E)"

[HKEY_CLASSES_ROOT/htmlfile/shell/Edit/command]
@="/"F://Program Files//Microsoft Office//Office//msohtmed.exe/" %1"

[HKEY_CLASSES_ROOT/htmlfile/shell/FantasiaWebExplorer]

[HKEY_CLASSES_ROOT/htmlfile/shell/FantasiaWebExplorer/Command]
@="D://Documents and Settings//Administrator//My Documents//Fantasia2001//Fantasia.exe %1"

[HKEY_CLASSES_ROOT/htmlfile/shell/InternetExplorer]

[HKEY_CLASSES_ROOT/htmlfile/shell/InternetExplorer/Command]
@="/"D://Program Files//Internet Explorer//iexplore.exe/" %1"

[HKEY_CLASSES_ROOT/htmlfile/shell/iWander]

[HKEY_CLASSES_ROOT/htmlfile/shell/iWander/command]
@="F://Program Files//iWander//iWander.exe /"%1/""

[HKEY_CLASSES_ROOT/htmlfile/shell/open]
@="在同一窗口中打开(&A)"

[HKEY_CLASSES_ROOT/htmlfile/shell/open/command]
@="/"D://Program Files//Internet Explorer//iexplore.exe/" -nohome"

[HKEY_CLASSES_ROOT/htmlfile/shell/open/ddeexec]
@="/"file://%1/",,-1,,,,,"
"NoActivateHandler"=""

[HKEY_CLASSES_ROOT/htmlfile/shell/open/ddeexec/Application]
@="IExplore"

[HKEY_CLASSES_ROOT/htmlfile/shell/open/ddeexec/Topic]
@="WWW_OpenURL"

[HKEY_CLASSES_ROOT/htmlfile/shell/opennew]
@="打开(&O)"

[HKEY_CLASSES_ROOT/htmlfile/shell/opennew/command]
@="/"D://Program Files//Internet Explorer//iexplore.exe/""

[HKEY_CLASSES_ROOT/htmlfile/shell/opennew/ddeexec]
@="[ViewFolder(/"%l/",/"%l/",%S)]"
"NoActivateHandler"=""

[HKEY_CLASSES_ROOT/htmlfile/shell/opennew/ddeexec/Application]
@="Folders"

[HKEY_CLASSES_ROOT/htmlfile/shell/opennew/ddeexec/Topic]
@="AppProperties"

[HKEY_CLASSES_ROOT/htmlfile/shell/Print]
@="打印(&P)"

[HKEY_CLASSES_ROOT/htmlfile/shell/Print/command]
@="/"F://Program Files//Microsoft Office//Office//msohtmed.exe/" /p %1"

[HKEY_CLASSES_ROOT/htmlfile/shell/printto]

[HKEY_CLASSES_ROOT/htmlfile/shell/printto/command]
@=hex(2):72,00,75,00,6e,00,64,00,6c,00,6c,00,33,00,32,00,2e,00,65,00,78,00,65,/
00,20,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,6d,00,73,/
00,68,00,74,00,6d,00,6c,00,2e,00,64,00,6c,00,6c,00,2c,00,50,00,72,00,69,00,/
6e,00,74,00,48,00,54,00,4d,00,4c,00,20,00,22,00,25,00,31,00,22,00,20,00,22,/
00,25,00,32,00,22,00,20,00,22,00,25,00,33,00,22,00,20,00,22,00,25,00,34,00,/
22,00,00,00

看到了没有,HKEY_CLASSES_ROOT/htmlfile/shell有8项,除了系统默认的Edit,open,Print
等5项外,有三项就是外部浏览器的键值,Shell主键值@="iWander"就是指"iWander"为默认
浏览器,如果@='FantasiaWebExplorer',就指“FantasiaWebExplorer”为默认浏览器
 
非常感谢forgot2002
可我现在的默认浏览器是IE,shell的主键值却是open,shell下也没有
InternetExplorer这个目录,机子里还有一个TE,这个目录在shell下就有,
我用的是win2k个人版
 
为什么不能变通一下呢?你按照我给出的注册表格式强加上去不就得了,更改打开某种文件的
打开方式有很多方法,其实都是修改注册表中某些键值,如果有重复和冲突,Windows会有一个
优先选择的问题,我给你的是[HKEY_CLASSES_ROOT/htmlfile/shell],是最先的选择,所以不管
什么Windows版本都可以,至于腾讯浏览器,它没有在[HKEY_CLASSES_ROOT/htmlfile/shell]
下注册自己的键值很正常呀,如果只是默认打开html文件,可以不在[HKEY_CLASSES_ROOT/htmlfile/shell]
下注册自己的键值呀!比如我可以更改打开方式为笔记本,强迫笔记本打开html文件,那么你说笔记本是
浏览器吗?当然不是!这就好象跟先有鸡还是先有蛋的问题一样。
 
接受答案了.
 
后退
顶部