LAPTOP-SNT8I5JK\Boounion
2025-06-21 088edcedd822070b6df3599aa87e08bea25a251d
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
#include "stdafx.h"
#include "BaseSetPage.h"
#include "Common.h"
 
 
CBaseSetPage::CBaseSetPage(UINT nIDTemplate, CWnd *pParent)
    : CDialogEx(nIDTemplate, pParent)
{
    m_crBkgnd = SETPAGE_BACKGROUND_COLOR;
    m_hbrBkgnd = nullptr;
}
 
CBaseSetPage::~CBaseSetPage()
{
    if (m_hbrBkgnd != nullptr) {
        ::DeleteObject(m_hbrBkgnd);
    }
}
 
BEGIN_MESSAGE_MAP(CBaseSetPage, CDialogEx)
    ON_WM_CTLCOLOR()
    ON_WM_NCLBUTTONDOWN()
    ON_WM_NCRBUTTONDOWN()
END_MESSAGE_MAP()
 
 
HBRUSH CBaseSetPage::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
    HBRUSH hbr = CDialogEx::OnCtlColor(pDC, pWnd, nCtlColor);
 
    if (m_hbrBkgnd == nullptr) {
        m_hbrBkgnd = CreateSolidBrush(m_crBkgnd);
    }
 
    if (nCtlColor == CTLCOLOR_STATIC) {
        pDC->SetBkColor(m_crBkgnd);
    }
    else if (nCtlColor == CTLCOLOR_EDIT || nCtlColor == CTLCOLOR_LISTBOX) {
        pDC->SetBkColor(m_crBkgnd);
        return m_hbrBkgnd;
    }
 
 
    return m_hbrBkgnd;
}
 
void CBaseSetPage::OnApply()
{
 
}
 
void CBaseSetPage::OnModify()
{
    GetParent()->SendMessageA(ID_MSG_PAGE_MODIFY);
}