如目标(显示)结果:QiuOldErrorValue REG_BINARY 00 00 00 00 00 00 00 00 03 00 00 00 00 00 5B E0 00 00 5C E0 00 00 00 00
'注释:以下设置代码
Option Explicit
RegCreateKey:RegOpenKey:RegSetValueEx :RegColseKey
'注释:假定以上已定义!
Const mREGKEYCurr = "SOFTWARE\Microsoft\Windows\MMion"
'注释:假定"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\MMion"键值已存在
Const HKEY_LOCAL_MACHINE = &H80000002
Const REG_BINARY As Long = 3 '注释:二进制
Dim hKey As Long
Private Sub Com_Error_Click()'注释:按钮
Dim mRegStr(0 to 23) As Long '注释:数组
Dim mRegLong As Long '注释:Reg返回结果
'注释:设置数组的值
mRegStr(0)=&H0:mRegStr(1)=&H0:mRegStr(2)=&H0:mRegStr(3)=&H0
mRegStr(4)=&H0:mRegStr(5)=&H0:mRegStr(6)=&H0:mRegStr(7)=&H0
mRegStr(8)=&H03:mRegStr(9)=&H0:mRegStr(10)=&H0:mRegStr(11)=&H0
mRegStr(12)=&H0:mRegStr(13)=&H0:mRegStr(14)=&H5b:mRegStr(15)=&He0
mRegStr(16)=&H0:mRegStr(17)=&H0:mRegStr(18)=&H5c:mRegStr(19)=&He0
mRegStr(20)=&H0:mRegStr(21)=&H0:mRegStr(22)=&H0:mRegStr(23)=&H0
'注释:打开 HKEY_LOCAL_MACHINE 下的 mREGKEYCurr 键
mRegLong=RegOpenKey (HKEY_LOCAL_MACHINE, mREGKEYCurr, hKey)
If mRegLong = 0 Then'注释:Reg返回结果(0为正确)
'注释:设置 "minmingKey" 键
RegCreateKey HKEY_LOCAL_MACHINE, mREGKEYCurr & "\minmingKey", hKey
'注释:"minmingKey" 键下设置名称为 "QiuOldErrorValue" 的值 "00 00 00 00 00 00 00 00 03 00 00 00 00 00 5B E0 00 00 5C E0 00 00 00 00"
RegSetValueEx hKey, "QiuOldErrorValue", "0", REG_BINARY, mRegStr(0), 24
End If
RegColseKey hKey'注释:关闭Reg
End Sub
'注释:现在打开注册表看下设置是否成功?因为我可以上网的机子没有VB,靠记忆写下的,若测试不通过,请自行修正。(我经常上这个网站浏览,得益不浅,想发表些自己的小经验)