mfc 对话框刷背景色

CDC *pDC=GetDC();
  pDC->GetBkColor();

  // TODO: 刷黑背景
  RECT rc;
  GetClientRect(&rc);
 //
  LOGBRUSH lb;
  HBRUSH   hb;
  lb.lbStyle = BS_SOLID;
  lb.lbColor = RGB(0, 0, 0);
  lb.lbHatch = 0;
  hb         = CreateBrushIndirect( &lb );
  FillRect(pDC->m_hDC, &rc, hb);
  DeleteObject(hb);

猜你喜欢

转载自blog.csdn.net/spy20008/article/details/24178827
今日推荐