void CNcEliteIIDlg::OnPaint()
{
if (IsIconic())
{
CPaintDC dc(this); // 用于绘制的设备上下文
SendMessage(WM_ICONERASEBKGND, reinterpret_cast<WPARAM>(dc.GetSafeHdc()), 0);
// 使图标在工作区矩形中居中
int cxIcon = GetSystemMetrics(SM_CXICON);
int cyIcon = GetSystemMetrics(SM_CYICON);
CRect rect;
GetClientRect(&rect);
int x = (rect.Width() - cxIcon + 1) / 2;
int y = (rect.Height() - cyIcon + 1) / 2;
// 绘制图标
dc.DrawIcon(x, y, m_hIcon);
}
else
{
CPaintDC dc(this); // device context for painting
//画横线
CRect rect, rc;
m_ctrlButton[0].GetClientRect(&rc);
rect = m_rcScreen;
rect.top = rect.bottom - rc.Height()-30;
dc.Draw3dRect(rect,RGB(0,0,0), RGB(64,64,64));
//GetClientRect(rect);
//自定义end
CDialog::OnPaint();
}
}
{
if (IsIconic())
{
CPaintDC dc(this); // 用于绘制的设备上下文
SendMessage(WM_ICONERASEBKGND, reinterpret_cast<WPARAM>(dc.GetSafeHdc()), 0);
// 使图标在工作区矩形中居中
int cxIcon = GetSystemMetrics(SM_CXICON);
int cyIcon = GetSystemMetrics(SM_CYICON);
CRect rect;
GetClientRect(&rect);
int x = (rect.Width() - cxIcon + 1) / 2;
int y = (rect.Height() - cyIcon + 1) / 2;
// 绘制图标
dc.DrawIcon(x, y, m_hIcon);
}
else
{
CPaintDC dc(this); // device context for painting
//画横线
CRect rect, rc;
m_ctrlButton[0].GetClientRect(&rc);
rect = m_rcScreen;
rect.top = rect.bottom - rc.Height()-30;
dc.Draw3dRect(rect,RGB(0,0,0), RGB(64,64,64));
//GetClientRect(rect);
//自定义end
CDialog::OnPaint();
}
}