www.pudn.com > newcode-TestUsb.zip > MyEdit.cpp


// MyEdit.cpp : implementation file 
// 
 
#include "stdafx.h" 
#include "TestUsb5.h" 
#include "MyEdit.h" 
 
#ifdef _DEBUG 
#define new DEBUG_NEW 
#undef THIS_FILE 
static char THIS_FILE[] = __FILE__; 
#endif 
 
///////////////////////////////////////////////////////////////////////////// 
// CMyEdit 
 
CMyEdit::CMyEdit() 
{ 
} 
 
CMyEdit::~CMyEdit() 
{ 
} 
 
 
BEGIN_MESSAGE_MAP(CMyEdit, CEdit) 
	//{{AFX_MSG_MAP(CMyEdit) 
	ON_WM_CTLCOLOR() 
	ON_WM_DRAWITEM() 
	//}}AFX_MSG_MAP 
END_MESSAGE_MAP() 
 
///////////////////////////////////////////////////////////////////////////// 
// CMyEdit message handlers 
 
HBRUSH CMyEdit::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)  
{ 
	HBRUSH hbr = CEdit::OnCtlColor(pDC, pWnd, nCtlColor); 
	 
	// TODO: Change any attributes of the DC here 
	CBrush brush(RGB(255,255,0)); 
	//pDC->SelectObject(&brush); 
	pDC->SetBkColor(RGB(255,255,0)); 
	return brush; 
	// TODO: Return a different brush if the default is not desired 
//	return hbr; 
} 
 
void CMyEdit::OnDrawItem(int nIDCtl, LPDRAWITEMSTRUCT lpDrawItemStruct)  
{ 
	// TODO: Add your message handler code here and/or call default 
	C 
	CEdit::OnDrawItem(nIDCtl, lpDrawItemStruct); 
}