对话框字符集设置为unicode字符集时当鼠标滑过编辑框会出现黑色背景!解决方法

对话框字符集设置为unicode字符集时当鼠标滑过编辑框会出现黑色背景!
写了一个对话框的界面,上面有几个编辑框,之前代码中是有ANSI字符集的,后来统一改为_T的,即可以支持ANSI也可以支持UNICODE了。然后,我把工程的属性中“配置属性-常规-字符集”设置为使用UNICODE字符集,运行的时候发现当鼠标滑过编辑框的时候,编辑框的背景变为了黑色。把字符集设置为“使用多字节字符集”或者“未设置”,则不会出现该问题。求高手指教!
对话框字符集设置为unicode字符集时当鼠标滑过编辑框会出现黑色背景!解决方法
如上图,下面是鼠标滑过的编辑框,上面的编辑框鼠标还没有滑过,所以显示是正常的。求指导啊
------解决思路----------------------
首先纠正一个错误.
后来统一改为_T的,即可以支持ANSI也可以支持UNICODE了
这是错的. 修改_T  后,仅仅是编译器会根据你的编译环境设置多字符集或者UNICODE而决定这个串替换成什么东西.
实际上还是只能支持一种字符集. 

再有: 
看你的界面, 不像是VC系列编译器的默认样子.  估计是进行了自绘.  如果确实有自绘控件, 那么问题肯定就在这部分.
------解决思路----------------------
CWnd::OnEraseBkgnd  
afx_msg BOOL OnEraseBkgnd( CDC* pDC );

Return Value

Nonzero if it erases the background; otherwise 0.

Parameters

pDC

Specifies the device-context object.

Remarks

The framework calls this member function when the CWnd object background needs erasing (for example, when resized). It is called to prepare an invalidated region for painting.

The default implementation erases the background using the window class background brush specified by the hbrBackground member of the window class structure. 

If the hbrBackground member is NULL, your overridden version of OnEraseBkgnd should erase the background color. Your version should also align the origin of the intended brush with the CWnd coordinates by first callingUnrealizeObject for the brush, and then selecting the brush.

An overridden OnEraseBkgnd should return nonzero in response to WM_ERASEBKGND if it processes the message and erases the background; this indicates that no further erasing is required. If it returns 0, the window will remain marked as needing to be erased. (Typically, this means that the fErase member of the PAINTSTRUCT structure will be TRUE.) 

Windows assumes the background is computed with the MM_TEXT mapping mode. If the device context is using any other mapping mode, the area erased may not be within the visible part of the client area.

Note   This member function is called by the framework to allow your application to handle a Windows message. The parameters passed to your function reflect the parameters received by the framework when the message was received. If you call the base-class implementation of this function, that implementation will use the parameters originally passed with the message and not the parameters you supply to the function.

CWnd Overview 
------解决思路----------------------
  Class Members 
------解决思路----------------------
  Hierarchy Chart

See Also   WM_ICONERASEBKGND, CGdiObject::UnrealizeObject,WM_ERASEBKGND