'LONG RegLoadKey(
' HKEY hKey,
' LPCTSTR lpSubKey,
' LPCTSTR lpFile
');
Private Declare Auto Function RegLoadKey Lib "advapi32.dll" ( _
ByVal hKey As IntPtr, _
ByVal lpSubKey As String, _
ByVal lpFile As String _
) As Integer
'LONG RegUnLoadKey(
' HKEY hKey,
' LPCTSTR lpSubKey
');
Private Declare Auto Function RegUnLoadKey Lib "advapi32.dll" ( _
ByVal hKey As IntPtr, _
ByVal lpSubKey As String _
) As Integer
Public Sub LoadKey(ByVal key As RegistryKey, ByVal MountPoint As String, ByVal HivePath As String)
Dim ret As Integer
ret = RegLoadKey(key.hKey, MountPoint, HivePath)
If ret <> 0 Then
Throw New Win32Exception(ret)
End If
End Sub
Public Sub UnLoadKey(ByVal Key As RegistryKey, ByVal MountPoint As String)
Dim ret As Integer
ret = RegUnLoadKey(Key.hKey, MountPoint)
If ret <> 0 Then
Throw New Win32Exception(ret)
End If
End Sub
|