⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 customco.cpp

📁 讲mfc的书
💻 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;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -