WEB开发网
开发学院软件开发VC 仿制金山毒霸专杀工具界面 阅读

仿制金山毒霸专杀工具界面

 2006-07-19 11:28:28 来源:WEB开发网   
核心提示: void CInterfaceDlg::OnPaint(){if (IsIconic()){CPaintDC dc(this); // device context for paintingSendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafe
void CInterfaceDlg::OnPaint()
{
  if (IsIconic())
  {
    CPaintDC dc(this); // device context for painting
    SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0);
    // Center icon in client rectangle
    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;
    // Draw the icon
    dc.DrawIcon(x, y, m_hIcon);
  }
  else
  {
//   CDialog::OnPaint();//将这一句注销掉
    ***************************************************************
    CPaintDC dc(this);
    CRect rect;
    GetClientRect(&rect);//得到窗体的大小
    CDC dcMem;
    dcMem.CreateCompatibleDC(&dc);
    CBitmap bmpBackground;
    bmpBackground.LoadBitmap(IDB_BITMAPBACKGROUND);//加载背景图片
    BITMAP bitMap;
    bmpBackground.GetBitmap(&bitMap);
    CBitmap *pbmpOld=dcMem.SelectObject(&bmpBackground);
    dc.StretchBlt(0,0,rect.Width(),rect.Height(),&dcMem,0,0,bitMap.bmWidth,bitMap.bmHeight,SRCCOPY);//画窗体
    **************************************************************
  }
}

上一页  1 2 3 4 5  下一页

Tags:仿制 金山 毒霸

编辑录入:爽爽 [复制链接] [打 印]
赞助商链接