-
Notifications
You must be signed in to change notification settings - Fork 4
/
Registry.h
37 lines (28 loc) · 862 Bytes
/
Registry.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
#pragma once
#include <windows.h>
#include <tchar.h>
class CRegistry
{
public:
CRegistry(HKEY hRootKey = HKEY_CURRENT_USER);
virtual ~CRegistry();
public:
BOOL VerifyKey(LPCTSTR lpszPath);
BOOL VerifyValue(LPCTSTR lpszValue);
BOOL CreateKey(LPCTSTR lpszPath);
void Close();
BOOL DeleteValue(LPCTSTR lpszValue);
BOOL DeleteKey(LPCTSTR lpszPath);
BOOL Write(LPCTSTR pszKey, int iVal);
BOOL Write(LPCTSTR pszKey, DWORD dwVal);
BOOL Write(LPCTSTR pszKey, LPCTSTR lpszVal);
BOOL Read(LPCTSTR pszKey, int& iVal);
BOOL Read(LPCTSTR pszKey, DWORD& dwVal);
BOOL Read(LPCTSTR pszKey, CString& strVal);
BOOL IsEqual(LPCTSTR pszValue, int iVal);
BOOL IsEqual(LPCTSTR pszValue, DWORD dwVal);
BOOL IsEqual(LPCTSTR pszValue, LPCTSTR lpszVal);
protected:
HKEY m_hSubKey;
HKEY m_hRootKey;
};