16,471
社区成员
发帖
与我相关
我的任务
分享
class CMyDialog : public CDialog
{
enum { IDD = IDD_DIALOG1 };
DECLARE_MESSAGE_MAP()
public:
CMyDialog(CWnd* pParent = NULL);
virtual BOOL OnInitDialog();
afx_msg BOOL OnEraseBkgnd(CDC* pDC);
};
BEGIN_MESSAGE_MAP(CMyDialog, CDialog)
ON_WM_ERASEBKGND()
END_MESSAGE_MAP()
CMyDialog::CMyDialog(CWnd* pParent /*=NULL*/)
: CDialog(CMyDialog::IDD, pParent)
{
}
BOOL CMyDialog::OnInitDialog()
{
CDialog::OnInitDialog();
ModifyStyleEx(0, WS_EX_LAYERED);
SetLayeredWindowAttributes(RGB(1,2,3), 0, LWA_COLORKEY);
return TRUE;
}
BOOL CMyDialog::OnEraseBkgnd(CDC* pDC)
{
RECT rc;
GetClientRect(&rc);
pDC->FillSolidRect(&rc, RGB(1,2,3));
return TRUE;
}