Declare Public Function RegOpenKeyExA Lib "advapi32" Alias "RegOpenKeyExA" (Byval HKEY As Long,Byval lpszSubKey As String,Byval dwreserved As Integer,Byval samDesired As Long, keyresult As Long) As Long
Declare Public Function RegQueryValueExA Lib "advapi32" _
Alias "RegQueryValueExA" _
(Byval HKEY As Long,_
Byval lpszValueName As String,_
Byval dwreserved As Integer, _
lpdwtype As Long, _
Byval lpData As String, _
readbytes As Long) As Long
Declare Public Function RegCloseKey Lib "advapi32" _
Alias "RegCloseKey" (Byval HKEY As Long) As Long
Declare Public Function GetPrivateProfileStringA Lib "kernel32" _
Alias "GetPrivateProfileStringA"_
(Byval AppName As String,_
Byval KName As Any, _
Byval Def As String, _
Byval RStr As String, _
Byval nSize As Integer, _
Byval FName As String) As Integer
Function GetKey (myKey As String) As String
Dim HKEY_LOCAL_MACHINE As Long
Dim KEY_READ As Long
Dim HKEY_CURRENT_USER As Long
Dim HKEY_CLASSES_ROOT As Long
Dim KEY_QUERY_VALUE As Integer
Dim KEY_ENUMERATE_SUBKEYS As Integer
Dim KEY_NOTIFY As Integer
HKEY_CLASSES_ROOT= &H80000000
HKEY_CURRENT_USER= &H80000001
HKEY_LOCAL_MACHINE= &H80000002
KEY_QUERY_VALUE=1
KEY_ENUMERATE_SUBKEYS=8
KEY_NOTIFY=16
KEY_READ=KEY_QUERY_VALUE Or KEY_ENUMERATE_SUBKEYS Or KEY_NOTIFY
Dim lstat As Long
Dim KeyVal As Long
Dim KeyReadBytes As Long
Dim ValueType As Long
Dim ValueName As String
Dim ReturnedKeyContents As String * 255
ReturnedKeyContents=String$(255,Chr$(32))
'Open the registry and get the key address (myKey)