vb怎样设置或恢复ie为默认浏览器?

有时360成了默认浏览器,想把ie恢复成默认浏览器,怎样通过vb实现呢?... 有时360成了默认浏览器,想把ie恢复成默认浏览器,怎样通过vb实现呢? 展开
 我来答
帐号已注销
2013-06-10 · TA获得超过242个赞
知道小有建树答主
回答量:268
采纳率:0%
帮助的人:266万
展开全部
通过操作注册表可以实现
在模块中添加
Public Declare Function RegCloseKey Lib "advapi32.dll" (ByVal hKey As Long) As Long
Public Declare Function RegOpenKeyEx Lib "advapi32.dll" Alias "RegOpenKeyExA" (ByVal hKey As Long, ByVal lpSubKey As String, ByVal ulOptions As Long, ByVal samDesired As Long, phkResult As Long) As Long
Public Declare Function RegSetValueEx Lib "advapi32.dll" Alias "RegSetValueExA" (ByVal hKey As Long, ByVal lpValueName As String, ByVal Reserved As Long, ByVal dwType As Long, lpData As Any, ByVal cbData As Long) As Long
Public Const REG_SZ = 1
Public Const READ_CONTROL = &H20000
Public Const STANDARD_RIGHTS_WRITE = (READ_CONTROL)
Public Const KEY_SET_VALUE = &H2
Public Const SYNCHRONIZE = &H100000
Public Const KEY_WRITE = ((STANDARD_RIGHTS_WRITE Or KEY_SET_VALUE Or KEY_CREATE_SUB_KEY) And (Not SYNCHRONIZE))
Public Const HKEY_CLASSES_ROOT = &H80000000

在窗体某一合件中(如按钮的单击)添加代码:

RegOpenKeyEx HKEY_LOCAL_MACHINE, "http\shell\open\command", 0, KEY_WRITE, hhKey
RegSetValueEx hhKey, "", 0, REG_SZ, ByVal "C:\Program Files\Internet Explorer\iexplore.exe -nohome", 55
RegCloseKey hhKey
RegOpenKeyEx HKEY_LOCAL_MACHINE, "http\shell\open\ddeexec\Application", 0, KEY_WRITE, hhKey
RegSetValueEx hhKey, "", 0, REG_SZ, ByVal "IExplore",8
RegCloseKey hhKey
更多追问追答
追问
用你的代码显示:编译错误:要求常数表达式
追答
不好意思,把HKEY_LOCAL_MACHINE改成HKEY_CLASSES_ROOT
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式