-
Notifications
You must be signed in to change notification settings - Fork 6
/
Registry.h
73 lines (66 loc) · 2.45 KB
/
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
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
/////////////////////////////////////////////////////////////////////////////
// Copyright (C) 1998 by Shane Martin
// All rights reserved
//
// Distribute freely, except: don't remove my name from the source or
// documentation (don't take credit for my work), mark your changes (don't
// get me blamed for your possible bugs), don't alter or remove this
// notice.
// No warrantee of any kind, express or implied, is included with this
// software; use at your own risk, responsibility for damages (if any) to
// anyone resulting from the use of this software rests entirely with the
// user.
//
// Send bug reports, bug fixes, enhancements, requests, flames, etc., and
// I'll try to keep a version up to date. I can be reached as follows:
// shane.kim@kaiserslautern.netsurf.de
/////////////////////////////////////////////////////////////////////////////
#include <winreg.h>
#define REG_RECT 0x0001
#define REG_POINT 0x0002
class CRegistry : public CObject
{
// Construction
public:
CRegistry(HKEY hKeyRoot = HKEY_LOCAL_MACHINE);
virtual ~CRegistry();
struct REGINFO
{
LONG lMessage;
DWORD dwType;
DWORD dwSize;
} m_Info;
// Operations
public:
BOOL VerifyKey (HKEY hKeyRoot, LPCTSTR pszPath);
BOOL VerifyKey (LPCTSTR pszPath);
BOOL VerifyValue (LPCTSTR pszValue);
BOOL CreateKey (HKEY hKeyRoot, LPCTSTR pszPath);
BOOL Open (HKEY hKeyRoot, LPCTSTR pszPath);
void Close();
BOOL DeleteValue (LPCTSTR pszValue);
BOOL DeleteValueKey (HKEY hKeyRoot, LPCTSTR pszPath);
BOOL Write (LPCTSTR pszKey, int iVal);
BOOL Write (LPCTSTR pszKey, DWORD dwVal);
BOOL Write (LPCTSTR pszKey, LPCTSTR pszVal);
BOOL Write (LPCTSTR pszKey, CStringList& scStringList);
BOOL Write (LPCTSTR pszKey, CByteArray& bcArray);
BOOL Write (LPCTSTR pszKey, CStringArray& scArray);
BOOL Write (LPCTSTR pszKey, CDWordArray& dwcArray);
BOOL Write (LPCTSTR pszKey, CWordArray& wcArray);
BOOL Write (LPCTSTR pszKey, LPCRECT rcRect);
BOOL Write (LPCTSTR pszKey, LPPOINT& lpPoint);
BOOL Read (LPCTSTR pszKey, int& iVal);
BOOL Read (LPCTSTR pszKey, DWORD& dwVal);
BOOL Read (LPCTSTR pszKey, CString& sVal);
BOOL Read (LPCTSTR pszKey, CStringList& scStringList);
BOOL Read (LPCTSTR pszKey, CStringArray& scArray);
BOOL Read (LPCTSTR pszKey, CDWordArray& dwcArray);
BOOL Read (LPCTSTR pszKey, CWordArray& wcArray);
BOOL Read (LPCTSTR pszKey, CByteArray& bcArray);
BOOL Read (LPCTSTR pszKey, LPPOINT& lpPoint);
BOOL Read (LPCTSTR pszKey, LPRECT& rcRect);
protected:
HKEY m_hKey;
CString m_sPath;
};