This stupid problem is driving me crazy: I'm trying to retrieve Notepad++ installation directory fro the registry by reading the default value of HKLM\SOFTWARE\Notepad++
(which is C:\Program Files\Notepad++
).
I tried different methods, which all work on other keys, but not with Notepad++. All of the following methods work with all keys I tried but Notepad++:
// Using RegQueryStringValue
var
Mess: String;
...
If RegQueryStringValue(HKLM, 'SOFTWARE\Google\Chrome\NativeMessagingHosts\com.avast.nativeproxy', '', Mess) Then
MsgBox('Retrieved: '+Mess, mbInformation, MB_OK)
Else
MsgBox('Wala', mbError, MB_OK);
// Using registry constants
MsgBox('Your NPP: '+ExpandConstant('{reg:HKLM\SOFTWARE\Google\Chrome\NativeMessagingHosts\com.avast.nativeproxy,}), mbInformation, MB_OK);
Whenever I replace SOFTWARE\Google\Chrome\NativeMessagingHosts\com.avast.nativeproxy
with SOFTWARE\Notepad++
, I get an empty string (or RegQueryStringValue()
returns false).
I thought the ++
could cause problems so I also tried to double them, escape them with 'Notepad'+#43+#43
or 'Notepad%43%43'
but nothing is working.
Did I miss something obvious?