April 8, 2000

EnumRegistryValues – Retrieve all values under a Registry key

Private 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 LongPrivate Declare Function RegCloseKey Lib “advapi32.dll” (ByVal hKey As Long) As _ LongPrivate Declare Function RegEnumValue Lib “advapi32.dll” Alias “RegEnumValueA”

EnumRegistryKeys – Retrieve all the subkeys of a Registry key

Private 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 LongPrivate Declare Function RegCloseKey Lib “advapi32.dll” (ByVal hKey As Long) As _ LongPrivate Declare Function RegEnumKey Lib “advapi32.dll” Alias “RegEnumKeyA”

DeleteRegistryValue – Delete a value from the Registry

Private Declare Function RegDeleteValue Lib “advapi32.dll” Alias _ “RegDeleteValueA” (ByVal hKey As Long, ByVal lpValueName As String) As LongPrivate 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 LongPrivate Declare

GetRegistryValue – Read the value of a Registry key

Private 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 LongPrivate Declare Function RegCloseKey Lib “advapi32.dll” (ByVal hKey As Long) As _ LongPrivate Declare Function RegQueryValueEx Lib “advapi32.dll” Alias _

CreateRegistryKey – Create a key in the Registry

Private Declare Function RegCreateKeyEx Lib “advapi32.dll” Alias _ “RegCreateKeyExA” (ByVal hKey As Long, ByVal lpSubKey As String, _ ByVal Reserved As Long, ByVal lpClass As Long, ByVal dwOptions As Long, _ ByVal samDesired As Long, ByVal lpSecurityAttributes As Long, _ phkResult As Long, lpdwDisposition As Long) As LongPrivate Declare Function

SetRegistryValue – Write a value in the Registry

Private 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 LongPrivate Declare Function RegCloseKey Lib “advapi32.dll” (ByVal hKey As Long) As _ LongPrivate Declare Function RegSetValueEx Lib “advapi32.dll” Alias _

DeleteRegistryKey – Delete a key of the Registry

Private Declare Function RegDeleteKey Lib “advapi32.dll” Alias “RegDeleteKeyA” _ (ByVal hKey As Long, ByVal lpSubKey As String) As Long’ Delete a registry key” Under Windows NT it doesn’t work if the key contains subkeysSub DeleteRegistryKey(ByVal hKey As Long, ByVal KeyName As String) RegDeleteKey hKey, KeyNameEnd Sub

GetRegisteredUser – Retreive the name of the registered user

Private Declare Function GetVersion Lib “kernel32″ () As LongConst HKEY_LOCAL_MACHINE = &H80000002′ Return the name of the registered user” Requires the GetRegistryValue functionFunction GetRegisteredUser() As String Dim regKey As String ‘ this information is held in a Registry key whose path ‘ depends on the operating system installed If GetVersion()

CheckRegistryKey – Return True if a Registry key exists

Private 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 LongPrivate Declare Function RegCloseKey Lib “advapi32.dll” (ByVal hKey As Long) As _ LongConst KEY_READ = &H20019 ‘ ((READ_CONTROL Or KEY_QUERY_VALUE

No more posts to show