In Microsoft's documentation, I found the following paragraph
The HKEY_LOCAL_MACHINE\SOFTWARE\Classes key corresponds to the HKEY_CLASSES_ROOT key, which was retained for compatibility with earlier versions of COM.
Now, I am not sure which key the which in that paragraph refers to: the HKLM\SOFTWARE\Classes or the HKCU key.
I'd appreciate if someone could clarify.
HKEY_CLASSES_ROOT
(abbrev. HKCR
, not to be confused with HKC
U
, HKEY_CURRENT_USER
) is a merged view of the ...\Software\Classes
sub hierarchies in HKLM and HKCU.
This is actually documented, although it is not linked from the COM docs you refer to:
HKEY_CLASSES_ROOT Key:
Class registration and file name extension information is stored under both the
HKEY_LOCAL_MACHINE
andHKEY_CURRENT_USER
keys. TheHKEY_LOCAL_MACHINE\Software\Classes
key contains default settings that can apply to all users on the local computer. TheHKEY_CURRENT_USER\Software\Classes
key contains settings that apply only to the interactive user. TheHKEY_CLASSES_ROOT
key provides a view of the registry that merges the information from these two sources.HKEY_CLASSES_ROOT
also provides this merged view for applications designed for previous versions of Windows.
They even go into the details of this merge mess, but if you need any specific behavior from the merged view, you would be well advised to verify it, because the details are rather messy in my opinon:
If you write keys to a key under HKEY_CLASSES_ROOT, the system stores the information under HKEY_LOCAL_MACHINE\Software\Classes.
If you write values to a key under HKEY_CLASSES_ROOT, and the key already exists under HKEY_CURRENT_USER\Software\Classes, the system will store the information there instead of under HKEY_LOCAL_MACHINE\Software\Classes.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With