16,467
社区成员
发帖
与我相关
我的任务
分享
DWORD stylex = GetWindowLong(GetSafeHwnd(), GWL_EXSTYLE);
stylex |= WS_EX_LAYERED;
SetWindowLong(GetSafeHwnd(), GWL_EXSTYLE, stylex);
SetLayeredWindowAttributes( 0, 255, LWA_ALPHA);
void CSimple1DemoDlg::OnNcPaint()
{
CRect rc;
GetWindowRect(&rc);
rc.OffsetRect(-rc.TopLeft());
CWindowDC dc(this);
Color clr(255, 255, 0, 0);
SolidBrush brush(clr);
Graphics g(dc.GetSafeHdc());
g.FillRectangle(&brush, rc.left, rc.top, rc.Width(), rc.Height());
}
void CSimple1DemoDlg::OnNcPaint()
{
CRect rc;
GetWindowRect(&rc);
rc.OffsetRect(-rc.TopLeft());
CWindowDC dc(this);
//Color clr(255, 255, 0, 0);
//SolidBrush brush(clr);
//Graphics g(dc.GetSafeHdc());
//g.FillRectangle(&brush, rc.left, rc.top, rc.Width(), rc.Height());
dc.FillSolidRect(&rc, RGB(255, 0, 0));
}