-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathRegistryKey.h
More file actions
30 lines (23 loc) · 858 Bytes
/
RegistryKey.h
File metadata and controls
30 lines (23 loc) · 858 Bytes
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
#pragma once
namespace NppShell::Registry
{
class RegistryKey
{
public:
RegistryKey(HKEY hKey, const wstring& subKey = L"", REGSAM access = KEY_READ, bool createIfMissing = false);
~RegistryKey();
static bool KeyExists(HKEY hKey, const wstring& subKey);
bool ValueExists(const wstring& valueName) const;
RegistryKey GetSubKey(const wstring& subKey, bool createIfMissing = false) const;
DWORD GetDwordValue(const wstring& valueName);
wstring GetStringValue(const wstring& valueName);
void SetDwordValue(const wstring& valueName, DWORD value);
void SetStringValue(const wstring& valueName, const wstring& value);
void DeleteKey();
private:
HKEY m_hKey;
REGSAM m_regsam;
HKEY m_originalHKey;
wstring m_originalSubKey;
};
}