HeX0R hat geschrieben: 15.10.2025 20:18 In fact there is an easier way to read registry values, I just can't remember the API command![]()
Ja, es gibt die Shell Funktionen, für einfache (einzelne) Zugriffe innerhalb eines Schlüssels.
Allerdings braucht der API Aufruf ein bisschen Beiwert.
Vorab: Der Befehl wird das gleiche Ergebnis liefern, wenn der Schlüssel nicht existiert. Deshalb mein o.g. Vorschlag, da kann man dann einfach einen Schlüsseleintrag wegnehmen und man sieht alle übergeordneten Schlüssel. Wenn da Notepad++ nicht dabei ist......
P.S.: Vielleicht nutzt du ja die (nicht-installierte) Version aus einem ZIp-Archiv. Dann haste die Reg Einträge nicht.
Das angepasste Beispiel zur oben genannten API Funktion:
Code: Alles auswählen
; LSTATUS SHGetValue(HKEY hkey, LPCTSTR pszSubKey, LPCTSTR pszValue, LPDWORD pdwType, LPVOID pvData, LPDWORD pcbData);
;
Procedure.s Registry_GetValue(RootKey, SubKey$, Value$)
Protected result$, dwType.l, size.l
size = 512
result$ = Space(size) ; >> 1 is wrong
If SHGetValue_(RootKey, @SubKey$, @Value$, @dwType, @result$, @size) = #ERROR_SUCCESS
; registry call was successful ...
;
If dwType = #REG_SZ ; check the type (just in case)
result$ = Trim(result$) ; probably not needed
EndIf
Else
; ... or a nonzero error code defined in Winerror.h otherwise
;
; Note:
; Use FormatMessage() with the FORMAT_MESSAGE_FROM_SYSTEM flag to retrieve a generic description of the error.
;
result$ = "" ; return something
EndIf
ProcedureReturn result$
EndProcedure
; Debug GetRegistryValue(#HKEY_LOCAL_MACHINE, "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Notepad++", "DisplayIcon")
Debug Registry_GetValue(#HKEY_LOCAL_MACHINE, "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Notepad++", "DisplayIcon")