|
// PageIcon.cpp : implementation file
//
///////////////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "HighColorTab.h"
#include "PageIcon.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CPageIcon property page
IMPLEMENT_DYNAMIC(CPageIcon, CPropertyPage)
CPageIcon::CPageIcon(const char* lpszTitle, UINT nIconID)
: CPropertyPage(CPageIcon::IDD),
m_nIconID(nIconID),
m_hIcon(NULL)
{
//{{AFX_DATA_INIT(CPageIcon)
//}}AFX_DATA_INIT
// Set the title and icon.
if( NULL != m_nIconID )
{
m_psp.dwFlags |= PSP_USEHICON;
HICON hIconTab = AfxGetApp()->LoadIcon( m_nIconID );
m_psp.hIcon = hIconTab;
}
}
CPageIcon::~CPageIcon()
{
}
void CPageIcon::DoDataExchange(CDataExchange* pDX)
{
CPropertyPage::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CPageIcon)
DDX_Control(pDX, IDC_PAGE_ICON, m_staticIcon);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CPageIcon, CPropertyPage)
//{{AFX_MSG_MAP(CPageIcon)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CPageIcon message handlers
BOOL CPageIcon::OnInitDialog()
{
CPropertyPage::OnInitDialog();
// Set icon
if( NULL != m_nIconID )
{
m_hIcon = ::LoadIcon( ::AfxGetInstanceHandle(), MAKEINTRESOURCE(m_nIconID) );
ASSERT (m_hIcon );
m_staticIcon.ModifyStyle( 0, SS_ICON );
m_staticIcon.SetIcon( m_hIcon );
}
else
{
m_staticIcon.SetWindowText("No icon");
}
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.