这函数是擦出非客户区颜色 ,重新下色

这函数是擦出非客户区颜色 ,重新上色?

void EraseNonClient()
{
// get window DC that is clipped to the non-client area
CWindowDC dc(this);
CRect rectClient;
GetClientRect(rectClient);
CRect rectWindow;
GetWindowRect(rectWindow);
ScreenToClient(rectWindow);
rectClient.OffsetRect(-rectWindow.left, -rectWindow.top);
dc.ExcludeClipRect(rectClient);

// draw borders in non-client area
rectWindow.OffsetRect(-rectWindow.left, -rectWindow.top);
DrawBorders(&dc, rectWindow);

// erase parts not drawn
dc.IntersectClipRect(rectWindow);
SendMessage(WM_ERASEBKGND, (WPARAM)dc.m_hDC);

//DrawGripper(&dc, rectWindow); //
}

------最佳解决方案--------------------
CWindowDC dc(this);

这个DC是专门画窗体和边框。
------其他解决方案--------------------
从函数名顾名思义来看,是擦除非客户区
从代码来看,是重画了非客户区的效果
------其他解决方案--------------------
试试不就知道了 不过ExcludeClipRect、IntersectClipRect我都没用过

感觉有点擦出部分区域做什么特殊效果似的
------其他解决方案--------------------
引用:
CWindowDC dc(this);

这个DC是专门画窗体和边框。


不都是dc嘛?

难道是封装了getwindowdc???