# 有关登录资料库

Posted by 征服未来 on May 07, 1999 at 11:00:31:

各位大哥大姐:
对于要如何去更改IE的预设
网页，小弟已经知道要去更改
WINDOWS内的”登录资料库”，
并配合下列VB的函数：
Declare Function RegCloseKey Lib "advapi32.dll" (ByVal hKey As Long) As Long
Declare Function RegOpenKey Lib "advapi32.dll" Alias "RegOpenKeyA" (ByVal hKey As Long, ByVal lpSubKey As String, phkResult As Long) As Long
Declare Function RegQueryValueEx Lib "advapi32.dll" Alias "RegQueryValueExA" (ByVal hKey As Long, ByVal lpValueName As String, ByVal lpReserved As Long, lpType As Long, lpData As Any, lpcbData As Long) As Long
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

之后小弟写了下列的程式：
Private Sub Command1_Click()
Dim hKyt As Long, typeData As Long, lenData As Long
Dim str As String
'HKEY_CURRENT_USER的KEY HANDLE 为&H80000001
RegOpenKey &H80000001, "Software\Microsoft\Internet Explorer\Main", hKey
Print hKey
RegQueryValueEx hKey, "Start Page", 0, typeData, ByVal str, lenData
str = Left(str, lenData - 1)
Print str
Print lenData
End Sub

lenData传回的值是没有问题，
（例如：”www.ftv.com.tw"是传回值是15)
但是为什么str的传回值却是空字串呢？？？
在此先行谢过各位大哥大姐了．．．．

征服未来　　1999/05/07

Follow Ups:

- 去参观一下 cww 兄的心得笔记就知道了 Sephiroth 14:05:42 5/07/99 (0)