// MyProgressDlg.cpp : implementation file // #include "stdafx.h" #include "myMailServer.h" #include "MyProgressDlg.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif ///////////////////////////////////////////////////////////////////////////// // CMyProgressDlg dialog CMyProgressDlg::CMyProgressDlg(CWnd* pParent /*=NULL*/) : CDialog(CMyProgressDlg::IDD, pParent) { //{{AFX_DATA_INIT(CMyProgressDlg) // NOTE: the ClassWizard will add member initialization here //}}AFX_DATA_INIT } void CMyProgressDlg::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(CMyProgressDlg) // NOTE: the ClassWizard will add DDX and DDV calls here //}}AFX_DATA_MAP } BEGIN_MESSAGE_MAP(CMyProgressDlg, CDialog) //{{AFX_MSG_MAP(CMyProgressDlg) ON_WM_CTLCOLOR() ON_WM_LBUTTONDOWN() ON_WM_CANCELMODE() //}}AFX_MSG_MAP END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // CMyProgressDlg message handlers BOOL CMyProgressDlg::OnInitDialog() { CDialog::OnInitDialog(); m_bmBack.DeleteObject(); m_brBack.DeleteObject(); m_bmBack.LoadBitmap(IDB_PROGRESS); //导入背景图片 m_brBack.CreatePatternBrush(&m_bmBack); //保存窗体背景图片,供OnCtlColor()调用 SetWindowText("Progress"); GetDlgItem(IDC_MESSAGE)->SetWindowText(m_message); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE } HBRUSH CMyProgressDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor) { HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor); if(nCtlColor == CTLCOLOR_DLG || nCtlColor == CTLCOLOR_BTN) { pDC->SetBkMode(TRANSPARENT); return m_brBack; } return hbr; } BOOL CMyProgressDlg::PreTranslateMessage(MSG* pMsg) { // TODO: Add your specialized code here and/or call the base class if(pMsg->message == WM_KEYDOWN && pMsg->wParam == VK_RETURN ) return true; return CDialog::PreTranslateMessage(pMsg); } void CMyProgressDlg::OnLButtonDown(UINT nFlags, CPoint point) { // TODO: Add your message handler code here and/or call default PostMessage(WM_NCLBUTTONDOWN,HTCAPTION,MAKELPARAM(point.x,point.y)); CDialog::OnLButtonDown(nFlags, point); } void CMyProgressDlg::OnCancelMode() { CDialog::OnCancelMode(); // TODO: Add your message handler code here }