Added reg_key_exists() function.
This commit is contained in:
parent
034e8f94f4
commit
6417c49b83
@ -82,6 +82,7 @@ namespace MUtils
|
||||
MUTILS_API bool reg_value_write (const reg_root_t &rootKey, const QString &keyName, const QString &valueName, const QString &value);
|
||||
MUTILS_API bool reg_value_read (const reg_root_t &rootKey, const QString &keyName, const QString &valueName, quint32 &value);
|
||||
MUTILS_API bool reg_value_read (const reg_root_t &rootKey, const QString &keyName, const QString &valueName, QString &value);
|
||||
MUTILS_API bool reg_key_exists (const reg_root_t &rootKey, const QString &keyName);
|
||||
MUTILS_API bool reg_key_delete (const reg_root_t &rootKey, const QString &keyName);
|
||||
MUTILS_API bool reg_enum_values (const reg_root_t &rootKey, const QString &keyName, QStringList &list);
|
||||
MUTILS_API bool reg_enum_subkeys(const reg_root_t &rootKey, const QString &keyName, QStringList &list);
|
||||
|
@ -340,6 +340,20 @@ bool MUtils::Registry::reg_enum_subkeys(const reg_root_t &rootKey, const QString
|
||||
return success;
|
||||
}
|
||||
|
||||
/*
|
||||
* Check registry key existence
|
||||
*/
|
||||
bool MUtils::Registry::reg_key_exists(const reg_root_t &rootKey, const QString &keyName)
|
||||
{
|
||||
HKEY hKey = NULL;
|
||||
if(RegOpenKeyEx(registry_root(rootKey), MUTILS_WCHR(keyName), 0, STANDARD_RIGHTS_READ, &hKey) == ERROR_SUCCESS)
|
||||
{
|
||||
RegCloseKey(hKey);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
* Delete registry key
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user