How to change background color of a dialog box by using ATL (243480)
The information in this article applies to:
- The Microsoft Active Template Library (ATL) 3.0, when used with:
- Microsoft Visual C++ .NET (2002)
- Microsoft Visual C++ .NET (2003)
- Microsoft Visual C++ 2005 Express Edition
This article was previously published under Q243480 Note Microsoft Visual C++ NET (2002) supported both the managed code
model that is provided by the Microsoft .NET Framework and the unmanaged native Microsoft Windows
code model. The information in this article applies to unmanaged Visual C++
code only.
Note Microsoft Visual C++ 2005 supports both the managed code
model that is provided by the .NET Framework and the unmanaged native Windows
code model. SUMMARY When creating dialog boxes in ATL 3.0, you can change the
background color that is used without much effort. This article shows you how
to change the background color for dialog boxes in ATL 3.0.
Basically, you need to handle the WM_CTLCOLORDLG message for the dialog box. You can do this by adding an entry
for this message in the message map and returning the handle to new brush with
desired color from this handler. REFERENCES For additional information, see the following article or
articles in the Microsoft Knowledge Base: 98201 HOWTO: Change Dialog Box Background Color in MFC 2.0 or Later
103786 HOWTO: Change Window Background Color with Foundation Classes
117778 HOWTO: Change the Background Color of an MFC Edit Control
132080 HOWTO: Change the Color of an MFC Child Control Class
Modification Type: | Major | Last Reviewed: | 1/17/2006 |
---|
Keywords: | kbATLWC kbDlg kbhowto KbUIDesign KB243480 kbAudDeveloper |
---|
|