本文整理汇总了C++中CKey::QueryValue方法的典型用法代码示例。如果您正苦于以下问题:C++ CKey::QueryValue方法的具体用法?C++ CKey::QueryValue怎么用?C++ CKey::QueryValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CKey
的用法示例。
在下文中一共展示了CKey::QueryValue方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ReadWorkDirInfo
void ReadWorkDirInfo(NWorkDir::CInfo &info)
{
info.SetDefault();
NSynchronization::CCriticalSectionLock lock(g_RegistryOperationsCriticalSection);
CKey optionsKey;
if(optionsKey.Open(HKEY_CURRENT_USER, GetKeyPath(kOptionsInfoKeyName), KEY_READ) != ERROR_SUCCESS)
return;
UInt32 dirType;
if (optionsKey.QueryValue(kWorkDirTypeValueName, dirType) != ERROR_SUCCESS)
return;
switch (dirType)
{
case NWorkDir::NMode::kSystem:
case NWorkDir::NMode::kCurrent:
case NWorkDir::NMode::kSpecified:
info.Mode = NWorkDir::NMode::EEnum(dirType);
}
UString sysWorkDir;
if (optionsKey.QueryValue(kWorkDirPathValueName, sysWorkDir) != ERROR_SUCCESS)
{
info.Path.Empty();
if (info.Mode == NWorkDir::NMode::kSpecified)
info.Mode = NWorkDir::NMode::kSystem;
}
info.Path = GetUnicodeString(sysWorkDir);
if (optionsKey.QueryValue(kTempRemovableOnlyValueName, info.ForRemovableOnly) != ERROR_SUCCESS)
info.SetForRemovableOnlyDefault();
}
示例2: ReadExtractionInfo
void ReadExtractionInfo(NExtract::CInfo &info)
{
info.Paths.Clear();
info.PathMode = NExtract::NPathMode::kCurrentPathnames;
info.OverwriteMode = NExtract::NOverwriteMode::kAskBefore;
info.ShowPassword = false;
NSynchronization::CCriticalSectionLock lock(g_RegistryOperationsCriticalSection);
CKey extractionKey;
if(extractionKey.Open(HKEY_CURRENT_USER, GetKeyPath(kExtractionKeyName), KEY_READ) != ERROR_SUCCESS)
return;
{
CKey pathHistoryKey;
if(pathHistoryKey.Open(extractionKey, kExtractionPathHistoryKeyName, KEY_READ) ==
ERROR_SUCCESS)
{
for (;;)
{
wchar_t numberString[16];
ConvertUInt64ToString(info.Paths.Size(), numberString);
UString path;
if (pathHistoryKey.QueryValue(numberString, path) != ERROR_SUCCESS)
break;
info.Paths.Add(path);
}
}
}
UInt32 extractModeIndex;
if (extractionKey.QueryValue(kExtractionExtractModeValueName, extractModeIndex) == ERROR_SUCCESS)
{
switch (extractModeIndex)
{
case NExtract::NPathMode::kFullPathnames:
case NExtract::NPathMode::kCurrentPathnames:
case NExtract::NPathMode::kNoPathnames:
info.PathMode = NExtract::NPathMode::EEnum(extractModeIndex);
break;
}
}
UInt32 overwriteModeIndex;
if (extractionKey.QueryValue(kExtractionOverwriteModeValueName, overwriteModeIndex) == ERROR_SUCCESS)
{
switch (overwriteModeIndex)
{
case NExtract::NOverwriteMode::kAskBefore:
case NExtract::NOverwriteMode::kWithoutPrompt:
case NExtract::NOverwriteMode::kSkipExisting:
case NExtract::NOverwriteMode::kAutoRename:
case NExtract::NOverwriteMode::kAutoRenameExisting:
info.OverwriteMode = NExtract::NOverwriteMode::EEnum(overwriteModeIndex);
break;
}
}
if (extractionKey.QueryValue(kExtractionShowPasswordValueName,
info.ShowPassword) != ERROR_SUCCESS)
info.ShowPassword = false;
}
示例3: ReadInternalAssociations
void ReadInternalAssociations(CObjectVector<CExtInfo> &items)
{
items.Clear();
NSynchronization::CCriticalSectionLock lock(g_CriticalSection);
CKey associationsKey;
if (associationsKey.Open(HKEY_CURRENT_USER, kAssociationsPath, KEY_READ) != ERROR_SUCCESS)
return;
CSysStringVector extNames;
associationsKey.EnumKeys(extNames);
for(int i = 0; i < extNames.Size(); i++)
{
const CSysString extName = extNames[i];
CExtInfo extInfo;
// extInfo.Enabled = false;
extInfo.Ext = GetUnicodeString(extName);
CKey key;
if (key.Open(associationsKey, extName, KEY_READ) != ERROR_SUCCESS)
return;
UString pluginsString;
key.QueryValue(kExtPlugins, pluginsString);
SplitString(pluginsString, extInfo.Plugins);
/*
if (key.QueryValue(kExtEnabled, extInfo.Enabled) != ERROR_SUCCESS)
extInfo.Enabled = false;
*/
items.Add(extInfo);
}
}
示例4: ReadUi32Val
bool ReadUi32Val(const TCHAR *name, UInt32 &value)
{
CKey key;
if (key.Open(HKEY_CURRENT_USER, kCUBasePath, KEY_READ) != ERROR_SUCCESS)
return false;
return key.QueryValue(name, value) == ERROR_SUCCESS;
}
示例5: ReadRegEditor
void ReadRegEditor(UString &editorPath)
{
editorPath.Empty();
CKey key;
if (key.Open(HKEY_CURRENT_USER, kCU_FMPath, KEY_READ) == ERROR_SUCCESS)
key.QueryValue(kEditor, editorPath);
}
示例6: ReadValue
static bool ReadValue(const TCHAR *value, UInt32 &result)
{
NSynchronization::CCriticalSectionLock lock(g_RegistryOperationsCriticalSection);
CKey optionsKey;
if(optionsKey.Open(HKEY_CURRENT_USER, GetKeyPath(kOptionsInfoKeyName), KEY_READ) != ERROR_SUCCESS)
return false;
return (optionsKey.QueryValue(value, result) == ERROR_SUCCESS);
}
示例7: ReadPanelPath
bool ReadPanelPath(UInt32 panel, UString &path)
{
NSynchronization::CCriticalSectionLock lock(g_CS);
CKey key;
if (key.Open(HKEY_CURRENT_USER, kCUBasePath, KEY_READ) != ERROR_SUCCESS)
return false;
return (key.QueryValue(GetPanelPathName(panel), path) == ERROR_SUCCESS);
}
示例8: CheckHandlerCommon
static bool CheckHandlerCommon(const CSysString &keyName, UInt32 wow)
{
CKey key;
if (key.Open(HKEY_CLASSES_ROOT, keyName, KEY_READ | wow) != ERROR_SUCCESS)
return false;
CSysString value;
if (key.QueryValue(NULL, value) != ERROR_SUCCESS)
return false;
return StringsAreEqualNoCase_Ascii(value, k_Clsid);
}
示例9: ReadOption
static bool ReadOption(const TCHAR *value, bool defaultValue)
{
NSynchronization::CCriticalSectionLock lock(g_RegistryOperationsCriticalSection);
CKey optionsKey;
if(optionsKey.Open(HKEY_CURRENT_USER, GetKeyPath(kOptionsInfoKeyName), KEY_READ) != ERROR_SUCCESS)
return defaultValue;
bool enabled;
if (optionsKey.QueryValue(value, enabled) != ERROR_SUCCESS)
return defaultValue;
return enabled;
}
示例10: ReadOption
static bool ReadOption(const TCHAR *value, bool defaultValue)
{
CKey key;
if (key.Open(HKEY_CURRENT_USER, kCU_FMPath, KEY_READ) == ERROR_SUCCESS)
{
bool enabled;
if (key.QueryValue(value, enabled) == ERROR_SUCCESS)
return enabled;
}
return defaultValue;
}
示例11: CheckHandlerCommon
static bool CheckHandlerCommon(const CSysString &keyName)
{
NSynchronization::CCriticalSectionLock lock(g_CS);
CKey key;
if (key.Open(HKEY_CLASSES_ROOT, keyName, KEY_READ) != ERROR_SUCCESS)
return false;
CSysString value;
if (key.QueryValue(NULL, value) != ERROR_SUCCESS)
return false;
return StringsAreEqualNoCase_Ascii(value, kExtensionCLSID);
}
示例12: CheckDragDropMenuHandlerCommon
static bool CheckDragDropMenuHandlerCommon(const CSysString &keyName)
{
NSynchronization::CCriticalSectionLock lock(g_RegistryOperationsCriticalSection);
CKey key;
if (key.Open(HKEY_CLASSES_ROOT, GetFullDragDropMenuKeyName(keyName), KEY_READ) != ERROR_SUCCESS)
return false;
CSysString value;
if (key.QueryValue(NULL, value) != ERROR_SUCCESS)
return false;
return (value.CompareNoCase(kExtensionCLSID) == 0);
}
示例13: CheckHandlerCommon
static bool CheckHandlerCommon(const CSysString &keyName)
{
NSynchronization::CCriticalSectionLock lock(g_CS);
CKey key;
if (key.Open(HKEY_CLASSES_ROOT, keyName, KEY_READ) != ERROR_SUCCESS)
return false;
CSysString value;
if (key.QueryValue(NULL, value) != ERROR_SUCCESS)
return false;
value.MakeUpper();
return (value.Compare(kExtensionCLSID) == 0);
}
示例14: ReadInternalAssociation
bool ReadInternalAssociation(const wchar_t *ext, CExtInfo &extInfo)
{
NSynchronization::CCriticalSectionLock lock(g_CriticalSection);
CKey key;
if (key.Open(HKEY_CURRENT_USER,
CSysString(kAssociationsPath TEXT(STRING_PATH_SEPARATOR)) +
GetSystemString(ext), KEY_READ) != ERROR_SUCCESS)
return false;
UString pluginsString;
key.QueryValue(kExtPlugins, pluginsString);
SplitString(pluginsString, extInfo.Plugins);
return true;
}
示例15: ReadFromRegistry
bool CShellExtInfo::ReadFromRegistry(HKEY hkey, const CSysString &ext)
{
ProgramKey.Empty();
IconPath.Empty();
IconIndex = -1;
// NSynchronization::CCriticalSectionLock lock(g_CriticalSection);
{
CKey extKey;
if (extKey.Open(hkey, GetExtKeyPath(hkey, ext), KEY_READ) != ERROR_SUCCESS)
return false;
if (extKey.QueryValue(NULL, ProgramKey) != ERROR_SUCCESS)
return false;
}
{
CKey iconKey;
if (iconKey.Open(hkey, GetFullKeyPath(hkey, ProgramKey + CSysString(TEXT(CHAR_PATH_SEPARATOR)) + kDefaultIconKeyName), KEY_READ) == ERROR_SUCCESS)
{
UString value;
if (iconKey.QueryValue(NULL, value) == ERROR_SUCCESS)
{
int pos = value.ReverseFind(L',');
IconPath = value;
if (pos >= 0)
{
const wchar_t *end;
Int32 index = ConvertStringToInt32((const wchar_t *)value + pos + 1, &end);
if (*end == 0)
{
// 9.31: if there is no icon index, we use -1. Is it OK?
if (pos != (int)value.Len() - 1)
IconIndex = (int)index;
IconPath.SetFrom(value, pos);
}
}
}
}
}
return true;
}