Click here to Skip to main content
15,897,704 members
Articles / Desktop Programming / WTL

WTL Icon Edit

Rate me:
Please Sign up or sign in to vote.
4.72/5 (14 votes)
28 Oct 20044 min read 64.6K   2.8K   22  
An article on WTL edit control with Icon.
// IconEditBlack.cpp : implementation file
//

#include "stdafx.h"
#include "IconEditBlack.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CIconEditBlack

BEGIN_MESSAGE_MAP(CIconEditBlack, CEdit)
	//{{AFX_MSG_MAP(CIconEditBlack)
	ON_WM_CTLCOLOR_REFLECT()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CIconEditBlack message handlers

HBRUSH CIconEditBlack::CtlColor(CDC* pDC, UINT nCtlColor) 
{
	if(IsWindowEnabled())
	{
		pDC->SetTextColor(RGB(255, 255, 255));
		pDC->SetBkColor(RGB(0, 0, 0));
		
		// TODO: Return a non-NULL brush if the parent's handler should not be called
		return (HBRUSH)::GetStockObject(BLACK_BRUSH);
	}
	else
	{
		pDC->SetTextColor(::GetSysColor(COLOR_GRAYTEXT));
		pDC->SetBkColor(::GetSysColor(COLOR_BTNFACE));

		return (HBRUSH)::CreateSolidBrush(::GetSysColor(COLOR_BTNFACE));
	}

	
}

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.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Other
Canada Canada
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions