// TaskProgressDlg.cpp : implementation file // #include "stdafx.h" #include "geomative.h" #include "TaskProgressDlg.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif extern int g_iUILanguage; ///////////////////////////////////////////////////////////////////////////// // CTaskProgressDlg dialog CTaskProgressDlg::CTaskProgressDlg(BOOL bRecvOrSend, UINT uiTotalFileNum, CDevice* pDev, CWnd* pParent /*=NULL*/) : CDialog(CTaskProgressDlg::IDD, pParent) { } CTaskProgressDlg::~CTaskProgressDlg() { } void CTaskProgressDlg::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(CTaskProgressDlg) // NOTE: the ClassWizard will add DDX and DDV calls here //}}AFX_DATA_MAP } BEGIN_MESSAGE_MAP(CTaskProgressDlg, CDialog) //{{AFX_MSG_MAP(CTaskProgressDlg) ON_WM_CLOSE() ON_MESSAGE(WM_UPDATE_TIPS, OnUpdateTips) //}}AFX_MSG_MAP END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // CTaskProgressDlg message handlers // void CTaskProgressDlg::OnClose() { CDialog::OnClose(); } BOOL CTaskProgressDlg::PreTranslateMessage(MSG* pMsg) { // TODO: Add your specialized code here and/or call the base class if (pMsg->message == WM_TIMER) { int i = 0; } if(pMsg->message==WM_KEYDOWN && pMsg->wParam==VK_RETURN) { return TRUE; } if(pMsg->message==WM_KEYDOWN && pMsg->wParam==VK_ESCAPE) { return TRUE; } return CDialog::PreTranslateMessage(pMsg); } BOOL CTaskProgressDlg::OnInitDialog() { CDialog::OnInitDialog(); // TODO: Add extra initialization here if (LANG_ZHCN == g_iUILanguage) { GetDlgItem(IDC_STATIC_SHOW_TIP)->SetWindowText(_T(" 程序正在处理中, 请等待并且不要操作程序.....")); } else { GetDlgItem(IDC_STATIC_SHOW_TIP)->SetWindowText(_T("The program is being processed. Please wait and do not operate the program.....")); } return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE } LRESULT CTaskProgressDlg::OnUpdateTips(WPARAM wParam, LPARAM lParam) { //m_pScheduler->Execute((UINT)wParam, (UINT)lParam); //m_wndToolBar.Invalidate(); //ShowControlBar(&m_wndToolBar, TRUE, FALSE); CString strFileName = (LPCTSTR)lParam; CString strContent; if (LANG_ZHCN == g_iUILanguage) { strContent = _T("正在处理文件:\t") + strFileName; } else { strContent = _T("NOW, processing file: \t") + strFileName; } GetDlgItem(IDC_TASK_PERCENT)->SetWindowText(strContent); UpdateData(FALSE); return 0; }