www.pudn.com > CHECKER.zip > CUSTOMCO.CPP


// customco.cpp : implementation file 
// 
 
#include "stdafx.h" 
#include "checker.h" 
#include "customco.h" 
 
#ifdef _DEBUG 
#undef THIS_FILE 
static char BASED_CODE THIS_FILE[] = __FILE__; 
#endif 
 
///////////////////////////////////////////////////////////////////////////// 
// CCustomColor dialog 
 
 
CCustomColor::CCustomColor(COLORREF color,DWORD flag,CWnd* pParent) 
	: CColorDialog(color,flag,pParent) 
{ 
	//{{AFX_DATA_INIT(CCustomColor) 
		// NOTE: the ClassWizard will add member initialization here 
	//}}AFX_DATA_INIT 
m_reset=FALSE; 
/* m_cc is a CHOOSECOLOR */ 
m_cc.lpTemplateName="CHOOSECOLOR"; 
m_cc.Flags|=CC_ENABLETEMPLATE;	  // don't disturb existing flags! 
// funny that the hInstance variable is declared as an HWND? 
m_cc.hInstance=(HWND)AfxGetInstanceHandle(); 
} 
 
 
void CCustomColor::DoDataExchange(CDataExchange* pDX) 
{ 
	CDialog::DoDataExchange(pDX); 
	//{{AFX_DATA_MAP(CCustomColor) 
		// NOTE: the ClassWizard will add DDX and DDV calls here 
	//}}AFX_DATA_MAP 
} 
 
 
BEGIN_MESSAGE_MAP(CCustomColor, CColorDialog) 
	//{{AFX_MSG_MAP(CCustomColor) 
	ON_BN_CLICKED(IDC_RESET, OnReset) 
	//}}AFX_MSG_MAP 
END_MESSAGE_MAP() 
 
 
///////////////////////////////////////////////////////////////////////////// 
// CCustomColor message handlers 
 
void CCustomColor::OnReset()  
{ 
	m_reset=TRUE; 
	EndDialog(IDOK);	 
} 
 
BOOL CCustomColor::OnInitDialog()  
{ 
	BOOL result=CColorDialog::OnInitDialog(); 
	 
	CWnd *newbutton=GetDlgItem(IDC_RESET); 
	newbutton->ShowWindow(SW_SHOW); 
	newbutton->EnableWindow(); 
	return result; 
}