Windows/MFC

CPropertyPageExt

aucd29 2013. 10. 2. 18:12
[code]// PropertyPageExt.cpp : implementation file
//

// DATE        : March 9, 2007
// CODER    : aucd29 (aucd29@gmail.com)
// VERSION    : 1.0
//
//

#include "stdafx.h"
#include "PropertyPageExt.h"


// CPropertyPageExt dialog

IMPLEMENT_DYNAMIC(CPropertyPageExt, CPropertyPage)

CPropertyPageExt::CPropertyPageExt()
: CPropertyPage()
{
    m_br3DFace.CreateSolidBrush(GetSysColor(COLOR_3DFACE));
}

CPropertyPageExt::CPropertyPageExt(UINT nIDTemplate)
: CPropertyPage(nIDTemplate)
{
    TRACE(L"ID : %d\n", nIDTemplate);
    m_br3DFace.CreateSolidBrush(GetSysColor(COLOR_3DFACE));
}

CPropertyPageExt::~CPropertyPageExt()
{
    m_br3DFace.DeleteObject();
}


BEGIN_MESSAGE_MAP(CPropertyPageExt, CPropertyPage)
    ON_WM_CTLCOLOR()
END_MESSAGE_MAP()


// CPropertyPageExt message handlers

HBRUSH CPropertyPageExt::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
    HBRUSH hbr = CPropertyPage::OnCtlColor(pDC, pWnd, nCtlColor);

    return (HBRUSH)GetStockObject(WHITE_BRUSH);
}
[/code]

[code]
#pragma once


// CPropertyPageExt dialog

class CPropertyPageExt : public CPropertyPage
{
    DECLARE_DYNAMIC(CPropertyPageExt)

public:
    CPropertyPageExt();
    CPropertyPageExt(UINT nIDTemplate);
    virtual ~CPropertyPageExt();

protected:
    DECLARE_MESSAGE_MAP()
protected:
    CBrush m_br3DFace;

public:
    afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor);
};
[/code]