Simply follow these steps in order to change the color of the Edit control or Combobox control in ATL.
Add a handler for WM_CTLCOLOREDIT
Implementation of the handler, return the brush that u want to use to color the control
LRESULT OnCtlColorEdit(UINT uMsg,
HDC hdcEdit = (HDC) wParam; // handle to display context
HWND hwndEdit = (HWND) lParam; // handle to static control
if (( hwndEdit == GetDlgItem(IDC_EDIT)
|| ( hwndEdit == GetDlgItem(IDC_COMBO))
// m_hBrush is an instance variable that stores the
// current Color brush. If this is the first time through
// we need to create it. The brush is deleted in the destructor
if ( m_hBrush == NULL )
m_hBrush = CreateSolidBrush( RGB(255,0,0)
// Get the DC provided and set the appropriate attributes
SetBkMode(hdcEdit, TRANSPARENT );
// Return a handle to the brush
HBRUSH far* hbr = (HBRUSH far*) m_hBrush;
return ((DWORD) hbr);
10 Rules that Make or Break Enterprise App Development Projects
In today's app-driven world, application development is a top priority. Even so, 68% of enterprise application delivery projects fail.
Designing and building applications that pay for themselves and adapt to future needs is incredibly difficult. Executing one successful project is lucky, but making it a repeatable process and strategic advantage? That's where the money is.
With help from our most experienced project leads and software engineers, …
Packaged application development teams frequently operate with limited testing environments due to time and labor constraints. By virtualizing the entire application stack, packaged application development teams can deliver business results faster, at higher quality, and with lower risk.