-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRegCtrl.h
More file actions
84 lines (75 loc) · 2.74 KB
/
RegCtrl.h
File metadata and controls
84 lines (75 loc) · 2.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#pragma once
#include <vector>
#include <string>
#include <Windows.h>
#pragma hdrstop
#include "StrCtrl.h"
class CRegCtrl;
extern CRegCtrl RegCtrl;
class CRegCtrl
{
public:
/**
* @brief 레지스트리에 값을 설정합니다.
* @param hKey 레지스트리 키
* @param subKey 서브 키
* @param valueName 값 이름
* @param data 설정할 데이터
* @return 설정 성공 여부
*/
bool SetRegistry(HKEY hKey, const std::string& subKey, const std::string& valueName, const std::string& data);
bool SetRegistry(HKEY hKey, const std::wstring& subKey, const std::wstring& valueName, const std::wstring& data);
/**
* @brief 레지스트리에서 값을 가져옵니다.
* @param hKey 레지스트리 키
* @param subKey 서브 키
* @param valueName 값 이름
* @param data 가져온 데이터
* @return 가져오기 성공 여부
*/
bool GetRegistry(HKEY hKey, const std::string& subKey, const std::string& valueName, std::string& data);
bool GetRegistry(HKEY hKey, const std::wstring& subKey, const std::wstring& valueName, std::wstring& data);
/**
* @brief 레지스트리에서 값을 제거합니다.
* @param hKey 레지스트리 키
* @param subKey 서브 키
* @param valueName 값 이름
* @return 삭제 성공 여부
*/
bool DeleteRegistry(HKEY hKey, const std::string& subKey, const std::string& valueName);
bool DeleteRegistry(HKEY hKey, const std::wstring& subKey, const std::wstring& valueName);
private:
/**
* @brief 레지스트리 키 열기
* @param hKey 레지스트리 키
* @param subKey 서브 키
* @param access 레지스트리 접근 권한
* @param resultKey 결과 키
* @return 열기 성공 여부
*/
bool OpenRegistryKey(HKEY hKey, const std::wstring& subKey, REGSAM access, HKEY& resultKey);
/**
* @brief 값을 쿼리합니다.
* @param resultKey 결과 키
* @param valueName 값 이름
* @param data 가져온 데이터
* @param dataSize 가져온 데이터 크기
* @return 쿼리 성공 여부
*/
bool QueryValue(HKEY resultKey, const std::wstring& valueName, std::wstring& data, DWORD& dataSize);
/**
* @brief 값을 설정합니다.
* @param resultKey 결과 키
* @param valueName 값 이름
* @param data 설정할 데이터
* @param dataSize 설정할 데이터 크기
* @return 설정 성공 여부
*/
bool SetValue(HKEY resultKey, const std::wstring& valueName, const std::wstring& data, DWORD dataSize);
/**
* @brief 레지스트리 키 닫기
* @param hKey 레지스트리 키
* @return 닫기 성공 여부
*/
bool CloseRegistryKey(HKEY hKey);
};