-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathRegSettings.h
77 lines (61 loc) · 1.87 KB
/
RegSettings.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
74
75
76
77
// RegSettings.h
//
// Copyright (c) 2001 Magomed Abdurakhmanov
// [email protected], http://mickels.iwt.ru/en
//
//
//
// No warranties are given. Use at your own risk.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_REGSETTINGS_H__91E69C67_8104_4819_969A_B5E71A9993D5__INCLUDED_)
#define AFX_REGSETTINGS_H__91E69C67_8104_4819_969A_B5E71A9993D5__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include <AtlMisc.h>
#include <AtlCtrls.h>
class CWindowSettings
{
public:
WINDOWPLACEMENT m_WindowPlacement;
CWindowSettings();
void GetFrom(CWindow& Wnd);
void ApplyTo(CWindow& Wnd, int nCmdShow = SW_SHOWNORMAL)const;
bool Load(LPCTSTR szRegKey, LPCTSTR szPrefix, HKEY hkRootKey = HKEY_CURRENT_USER);
bool Save(LPCTSTR szRegKey, LPCTSTR szPrefix, HKEY hkRootKey = HKEY_CURRENT_USER)const;
};
class CReBarSettings
{
public:
struct BandInfo
{
DWORD ID;
DWORD cx;
bool BreakLine;
bool Hidden;
}* m_pBands;
DWORD m_cbBandCount;
CReBarSettings();
~CReBarSettings();
void GetFrom(CReBarCtrl& ReBar);
void ApplyTo(CReBarCtrl& ReBar)const;
bool Load(LPCTSTR szRegKey, LPCTSTR szPrefix, HKEY hkRootKey = HKEY_CURRENT_USER);
bool Save(LPCTSTR szRegKey, LPCTSTR szPrefix, HKEY hkRootKey = HKEY_CURRENT_USER)const;
};
class CSplitterSettings
{
public:
DWORD m_dwPos;
template <class T> void GetFrom(const T& Splitter)
{
m_dwPos = Splitter.GetSplitterPos();
}
template <class T> void ApplyTo(T& Splitter)const
{
Splitter.SetSplitterPos(m_dwPos);
}
bool Load(LPCTSTR szRegKey, LPCTSTR szPrefix, HKEY hkRootKey = HKEY_CURRENT_USER);
bool Save(LPCTSTR szRegKey, LPCTSTR szPrefix, HKEY hkRootKey = HKEY_CURRENT_USER)const;
};
#endif // !defined(AFX_REGSETTINGS_H__91E69C67_8104_4819_969A_B5E71A9993D5__INCLUDED_)