如何改变视窗的背景颜色 如何改变视窗的背景颜色 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 SetClassLong(m_pWnd->hWnd, HBRUSH, 想要的颜色); Windows向窗口发送一个WM_ERASEBKGND消息通知该窗口擦除背景,可以使用ClassWizard重载该消息的缺省处理程序来擦除背景(实际是画),并返回TRUE以防止Windows擦除窗口。//Paint area that needs to be erased.BOOL CSampleView : : OnEraseBkgnd (CDC* pDC) BOOL CSampleView : : OnEraseBkgnd (CDC* pDC){// Create a pruple brush.CBrush Brush (RGB (128 , 0 , 128) );// Select the brush into the device context .CBrush* pOldBrush = pDC—>SelcetObject (&brush);// Get the area that needs to be erased .CRect reClip ;pDC—>GetCilpBox (&rcClip);//Paint the area.pDC—> PatBlt (rcClip.left , rcClip.top , rcClip.Width ( ) , rcClip.Height ( ) , PATCOPY );//Unselect brush out of device context .pDC—>SelectObject (pOldBrush );// Return nonzero to half fruther processing .return TRUE;} 下面三个图中是什么控件? 求一个opengl的三维场景的题目? VC查询数据库 对话框中循环问题 送分了,全部有分.... the problem of combo box? 求救不能使用msdn的痛苦,怎么将VC和msdn关联... 收集资料(肯定给分)!!! vc菜鸟,请教一个问题 求教vc读取excel的问题 如何单击除了窗口标题栏以外的区域使窗口移动 如何创建和使用无模式对话框
ClassWizard重载该消息的缺省处理程序来擦除背景(实际是画),并返回TRUE以
防止Windows擦除窗口。
//Paint area that needs to be erased.
BOOL CSampleView : : OnEraseBkgnd (CDC* pDC) BOOL CSampleView : : OnEraseBkgnd (CDC* pDC)
{
// Create a pruple brush.
CBrush Brush (RGB (128 , 0 , 128) );// Select the brush into the device context .
CBrush* pOldBrush = pDC—>SelcetObject (&brush);// Get the area that needs to be erased .
CRect reClip ;
pDC—>GetCilpBox (&rcClip);//Paint the area.
pDC—> PatBlt (rcClip.left , rcClip.top ,
rcClip.Width ( ) , rcClip.Height ( ) , PATCOPY );//Unselect brush out of device context .
pDC—>SelectObject (pOldBrush );// Return nonzero to half fruther processing .
return TRUE;
}