Hallo Zusammen,
ich möchte die in einem Registry Wert gespeicherte Pfadangabe lesen. Folgender Code funktionierte bis vor kurzem mit meinen NotesClient und funktioniert in Excel weiterhin prima. Leider zeigt mir Notes jetzt nur noch einen Leerstring.
Wie kann das sein?
Gruß Gerhard
----8<-----------------------------
Declare Function RegCloseKey Lib "advapi32.dll" (Byval HKey As Long) As Long
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 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
Function RegKeyRead(SubKey As String,Eintrag As String,Wert As Variant)
Dim RetVal As Long
Dim phkResult As Long
Dim HKey As Long
Dim Anzahl As Long
Wert = Space(255)
Anzahl=255
RetVal = RegOpenKeyEx(HKEY_LOCAL_MACHINE, SubKey, 0, KEY_QUERY_VALUE, HKey)
RetVal = RegQueryValueEx(HKey, Eintrag, 0, REG_SZ, Wert, Anzahl)
Wert = Mid(Wert, 1, Anzahl-1)
If RetVal=0 Then
RegKeyRead=1
Else
RegKeyRead=0
End If
RetVal = RegCloseKey(HKey)
End Function
----8<-----------------------------