Windows application uses HKEY_CURRENT_USER\Software\\\ as basic structure for storing and retreiving registry entries. Depending on an application type - MFC application, ATL Cotrol, Service or Snap-in, Win32 application - Microsoft offers three ways for working with registry. - MFC Application Microsoft's MFC AppWizard (exe) is using for key a default string - "Local AppWizard-Generated Applications" and substitutes with a name of MFC application set in wizard screen. You should this default string with the name of your company: SetRegistryKey( ); Interestingly that MFC unlike ATL, does not have a separate class for managing registry operations. Five registry functions used bt MFC ate member functions of CWinApp class. Besides CWinApp MFC member function SetRegistryKey MFC-application utilizes 4 functions of CWinApp MFC class for all MFC-application registry operations making possible to write/read string and integer values to a registry. These functions are: - WriteProfileString; - WriteProfileInt; - GetProfileString; - GetProfileInt; String values will appear in the registry as of REG_SZ type and integer values will appear as of REG_DWORD type. MFC operations with registry are most limited. First limitation is that MFC does not have registry functions for writing binary values that might be necessary when making an aplication font persistable. Second major limation is that MFC application is able to write/read to registry key located under HKEY_CURRENT_USER only. When it is necessary to write/read binary values and to write/read to registry key located under hives other then HKEY_CURRENT_USER, MFC application must use Win32 API functions. When subkey name is unknown and it is desirable to see all subkey names under specific key, MFC's CWinApp registry functions do not provide this option. This is the third limitation. Forth limitation comes when it is necessary to know subkeys and values under specified key. It is not possible with MFC just because the name of subkey or value name must be provided to get information about keys and values. - ATL Controls, Services and Snap-ins ATL has a separate class CRegKey with 11 member functions for handling registry. The functions are thin wrappers over Win32 API registry functions. With CRegKey member functions it is possble to access any registry key, but as with MFC CWinApp registry functions you can write/read string and integers only. Attach/Detach - are 2 functions to specify which key to work/end with. Create/DeleteSubKey/RecurseDeleteKey/DeleteValue - are 4 functions for cteation and deltion. Open/Close - are 2 functions to open close a key. SetValue/SetKeyValue/QueryValueKey - are 2 functions to read/write. - Win32 Application Win32 API offers much broader functionality for working with registry. There are 26 Win32 API functions for that purpose and additionally 13 functions that are considered obsolete. In addition to opening, creatind keys, deleting keys and values, setting, quering values that have corresponding wrapper functions in MFC and ATL, Win32 API lets list subkeys and values under any key without knowing the names of subkeys and values. Win32 registry functions let set and read security descriptors for access to key or a value. It is possible to get registry information over network, on remote machine and move keys and values. Appendix I - Registry Terminology: Hive - Registry Key that is permanent, not creaated dynamically. Hive is the place where bees are doing their work. HKEY_CURRENT_USER is a hive, HKEY_CURRENT_USER\Software is a hive also. Key - Key Name - Value - Value Name - Value Data - --------------------------------------------------------------------------------