本文整理汇总了C++中CKey::RecurseDeleteKey方法的典型用法代码示例。如果您正苦于以下问题:C++ CKey::RecurseDeleteKey方法的具体用法?C++ CKey::RecurseDeleteKey怎么用?C++ CKey::RecurseDeleteKey使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CKey
的用法示例。
在下文中一共展示了CKey::RecurseDeleteKey方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DeleteShellExtensionInfo
LONG DeleteShellExtensionInfo(HKEY hkey, const CSysString &ext)
{
// NSynchronization::CCriticalSectionLock lock(g_CriticalSection);
CKey rootKey;
rootKey.Attach(hkey);
LONG res = rootKey.RecurseDeleteKey(GetExtKeyPath(hkey, ext));
// then we delete only 7-Zip.* key.
rootKey.RecurseDeleteKey(GetFullKeyPath(hkey, GetExtProgramKeyName(ext)));
rootKey.Detach();
return res;
}
示例2: SaveCompressionInfo
void SaveCompressionInfo(const NCompression::CInfo &info)
{
NSynchronization::CCriticalSectionLock lock(g_RegistryOperationsCriticalSection);
CKey compressionKey;
compressionKey.Create(HKEY_CURRENT_USER, GetKeyPath(kCompressionKeyName));
compressionKey.RecurseDeleteKey(kCompressionHistoryArchivesKeyName);
{
CKey historyArchivesKey;
historyArchivesKey.Create(compressionKey, kCompressionHistoryArchivesKeyName);
for(int i = 0; i < info.HistoryArchives.Size(); i++)
{
wchar_t numberString[16];
ConvertUInt64ToString(i, numberString);
historyArchivesKey.SetValue(numberString, info.HistoryArchives[i]);
}
}
// compressionKey.SetValue(kSolid, info.Solid);
// compressionKey.SetValue(kMultiThread, info.MultiThread);
compressionKey.RecurseDeleteKey(kCompressionOptionsKeyName);
{
CKey optionsKey;
optionsKey.Create(compressionKey, kCompressionOptionsKeyName);
for(int i = 0; i < info.FormatOptionsVector.Size(); i++)
{
const NCompression::CFormatOptions &fo = info.FormatOptionsVector[i];
CKey formatKey;
formatKey.Create(optionsKey, fo.FormatID);
SetRegString(formatKey, kCompressionOptions, fo.Options);
SetRegString(formatKey, kCompressionMethod, fo.Method);
SetRegString(formatKey, kEncryptionMethod, fo.EncryptionMethod);
SetRegUInt32(formatKey, kCompressionLevel, fo.Level);
SetRegUInt32(formatKey, kCompressionDictionary, fo.Dictionary);
SetRegUInt32(formatKey, kCompressionOrder, fo.Order);
SetRegUInt32(formatKey, kCompressionBlockSize, fo.BlockLogSize);
SetRegUInt32(formatKey, kCompressionNumThreads, fo.NumThreads);
}
}
compressionKey.SetValue(kCompressionLevelValueName, UInt32(info.Level));
compressionKey.SetValue(kCompressionLastFormatValueName, GetSystemString(info.ArchiveType));
compressionKey.SetValue(kCompressionShowPasswordValueName, info.ShowPassword);
compressionKey.SetValue(kCompressionEncryptHeadersValueName, info.EncryptHeaders);
// compressionKey.SetValue(kCompressionMaximizeValueName, info.Maximize);
}
示例3: DeleteDragDropMenuHandlerCommon
static void DeleteDragDropMenuHandlerCommon(const CSysString &keyName)
{
CKey rootKey;
rootKey.Attach(HKEY_CLASSES_ROOT);
rootKey.RecurseDeleteKey(GetFullDragDropMenuKeyName(keyName));
rootKey.Detach();
}
示例4: DeleteShellExtensionProgramKey
static void DeleteShellExtensionProgramKey(const CSysString &extension)
{
NSynchronization::CCriticalSectionLock lock(g_CriticalSection);
CKey rootKey;
rootKey.Attach(HKEY_CLASSES_ROOT);
rootKey.RecurseDeleteKey(GetExtProgramKeyName(extension));
rootKey.Detach();
}
示例5: WriteInternalAssociations
void WriteInternalAssociations(const CObjectVector<CExtInfo> &items)
{
NSynchronization::CCriticalSectionLock lock(g_CriticalSection);
CKey mainKey;
mainKey.Create(HKEY_CURRENT_USER, kCUKeyPath);
mainKey.RecurseDeleteKey(kAssociations);
CKey associationsKey;
associationsKey.Create(mainKey, kAssociations);
for(int i = 0; i < items.Size(); i++)
{
const CExtInfo &extInfo = items[i];
CKey key;
key.Create(associationsKey, GetSystemString(extInfo.Ext));
key.SetValue(kExtPlugins, JoinStrings(extInfo.Plugins));
// key.SetValue(kExtEnabled, extInfo.Enabled);
}
}
示例6: SaveExtractionInfo
void SaveExtractionInfo(const NExtract::CInfo &info)
{
NSynchronization::CCriticalSectionLock lock(g_RegistryOperationsCriticalSection);
CKey extractionKey;
extractionKey.Create(HKEY_CURRENT_USER, GetKeyPath(kExtractionKeyName));
extractionKey.RecurseDeleteKey(kExtractionPathHistoryKeyName);
{
CKey pathHistoryKey;
pathHistoryKey.Create(extractionKey, kExtractionPathHistoryKeyName);
for(int i = 0; i < info.Paths.Size(); i++)
{
wchar_t numberString[16];
ConvertUInt64ToString(i, numberString);
pathHistoryKey.SetValue(numberString, info.Paths[i]);
}
}
extractionKey.SetValue(kExtractionExtractModeValueName, UInt32(info.PathMode));
extractionKey.SetValue(kExtractionOverwriteModeValueName, UInt32(info.OverwriteMode));
extractionKey.SetValue(kExtractionShowPasswordValueName, info.ShowPassword);
}
示例7: throw
LONG CKey::RecurseDeleteKey(LPCTSTR subKeyName) throw()
{
CKey key;
LONG res = key.Open(_object, subKeyName, KEY_READ | KEY_WRITE);
if (res != ERROR_SUCCESS)
return res;
FILETIME fileTime;
const UInt32 kBufferSize = MAX_PATH + 1; // 256 in ATL
DWORD size = kBufferSize;
TCHAR buffer[kBufferSize];
while (RegEnumKeyEx(key._object, 0, buffer, &size, NULL, NULL, NULL, &fileTime) == ERROR_SUCCESS)
{
res = key.RecurseDeleteKey(buffer);
if (res != ERROR_SUCCESS)
return res;
size = kBufferSize;
}
key.Close();
return DeleteSubKey(subKeyName);
}