mirror of
https://github.com/lifegpc/c-utils.git
synced 2026-06-06 13:18:57 +08:00
28 lines
837 B
C++
28 lines
837 B
C++
#ifndef _UTIL_REG_UTIL_H
|
|
#define _UTIL_REG_UTIL_H
|
|
#ifdef _WIN32
|
|
#include <windows.h>
|
|
#include <string>
|
|
namespace reg_util {
|
|
/**
|
|
* @brief Get string(REG_SZ) value from registry.
|
|
* @param result Result string
|
|
* @param hKey Registry key handle
|
|
* @param subKey Subkey path
|
|
* @param value Value name
|
|
* @return true if success, false otherwise.
|
|
*/
|
|
bool get_string(std::wstring& result, HKEY hKey, std::wstring subKey, std::wstring value);
|
|
/**
|
|
* @brief Get DWORD(REG_DWORD) value from registry.
|
|
* @param result Result DWORD
|
|
* @param hKey Registry key handle
|
|
* @param subKey Subkey path
|
|
* @param value Value name
|
|
* @return true if success, false otherwise.
|
|
*/
|
|
bool get_dword(DWORD& result, HKEY hKey, std::wstring subKey, std::wstring value);
|
|
}
|
|
#endif
|
|
#endif
|