这是重绘的函数:
void CLLKDlg::OnMenu()
{
CPaintDC dc(this); // device context for painting
dc.BitBlt(0,0,1024,768,&m_DC,0,0,SRCCOPY);
HRGN c,r1;
c = CreateRectRgn(8, 0, 55, 31);
r1 = CreateEllipticRgn(48, 8, 15 + 48, 15 + 8);
CombineRgn(c, c, r1, RGN_OR);
m_Btn1.Create("进入游戏", WS_CHILD | WS_VISIBLE, CPoint(16+650, 63 + 32 + 64 + 128+100), c,
this, MY_BTN1, 1, RGB(151, 219, 244), RGB(211, 247, 254), RGB(211, 247, 254),
GetSysColor(COLOR_BTNFACE));
r1 = CreateEllipticRgn(0, 8, 15, 15 + 8);
CombineRgn(c, c, r1, RGN_DIFF);
m_Btn2.Create("游戏说明", WS_CHILD | WS_VISIBLE, CPoint(16 + 48+650,
63 + 32 + 64 + 128+100), c, this,
MY_BTN2, 1, RGB(151, 219, 244), RGB(211, 247, 254), RGB(211, 247, 254),
GetSysColor(COLOR_BTNFACE));
m_Btn3.Create("关于作者", WS_CHILD | WS_VISIBLE, CPoint(16 + 48 + 48+650,
63 + 32 + 64 + 128+100), c, this, MY_BTN3, 1, RGB(151, 219, 244),
RGB(211, 247, 254), RGB(211, 247, 254), GetSysColor(COLOR_BTNFACE));
m_Btn4.Create("退出游戏",WS_CHILD |WS_VISIBLE, CPoint(16 + 48 + 48 + 48+650,
63 + 32 + 64 + 128+100), c, this, MY_BTN4, 1, RGB(151, 219, 244),
RGB(211, 247, 254), RGB(211, 247, 254), GetSysColor(COLOR_BTNFACE));
DeleteObject(c);
DeleteObject(r1);
}
这是调用对话框的函数:
void CLLKDlg::OnAbout()
{
CAboutDlg dlg;
int nResponse=dlg.DoModal();
if(nResponse=IDOK)
{
UpdateWindow();
}
}