-
Notifications
You must be signed in to change notification settings - Fork 4
/
RegistryKey.h
39 lines (30 loc) · 982 Bytes
/
RegistryKey.h
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
#ifndef REGISTRYKEY
#define REGISTRYKEY
#include <windows.h>
class RegistryKeyException {};
class RegistryKey
{
HKEY _handle;
UINT _isRoot;
RegistryKey(HKEY, UINT = 0);
public:
// Destructors
~RegistryKey();
// Root keys
static RegistryKey* ClassesRoot();
static RegistryKey* CurrentUser();
static RegistryKey* LocalMachine();
static RegistryKey* Users();
// Keys creation/destruction
RegistryKey* OpenKey(const char* subKey, UINT readOnly = 0);
RegistryKey* CreateKey(const char* subKey);
void DeleteKey(const char* subKey = 0);
// Data handling
long GetLong(const char* valueName);
void GetString(const char* valueName, char* buffer, size_t size);
void GetBinary(const char* valueName, void* destStruct, size_t size);
void SetLong(const char* valueName, long value);
void SetString(const char* valueName, const char* value);
void SetBinary(const char* valueName, const void* destStruct, size_t size);
};
#endif