bool THierarchicalStorage::HasSubKey(const UnicodeString & SubKey) { bool Result = OpenSubKey(SubKey, false); if (Result) { CloseSubKey(); } return Result; }
void THierarchicalStorage::RecursiveDeleteSubKey(const UnicodeString & Key) { if (OpenSubKey(Key, false)) { ClearSubKeys(); CloseSubKey(); } DeleteSubKey(Key); }
//***************************************************************************** //***************************************************************************** C_RegistryNode* C_RegistryNode::CreateSubNode(DWORD idx,REGSAM samDesired) { C_RegistryNode* RetVal = NULL; HKEY hKey; if(OpenSubKey(idx,samDesired,&hKey)==ERROR_SUCCESS) { RetVal = new C_RegistryNode; if(RetVal->Init(hKey)!=RGN_ERR_NONE) { delete RetVal; RetVal = NULL; }; }; return RetVal; };
CNCSPrefs::CNCSPrefsKey *CNCSPrefsWin::CNCSPrefsKeyWin::GetNextSubKey() { m_nEnumKeyIndex++; NCSTChar achKey[MAX_PATH]; FILETIME ftLastWriteTime; unsigned long nKeyNameLength = MAX_PATH; DWORD retCode = RegEnumKeyEx(m_hBaseKey, m_nEnumKeyIndex, achKey, &nKeyNameLength, NULL, NULL, NULL, &ftLastWriteTime); if( retCode == ERROR_SUCCESS ) { return OpenSubKey( achKey ); } return NULL; }
bool THierarchicalStorage::OpenRootKey(bool CanCreate) { return OpenSubKey(L"", CanCreate); }