// DLG_GetUser.cpp : implementation file // #include "stdafx.h" #include "CorpSms.h" #include "DLG_GetUser.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif ///////////////////////////////////////////////////////////////////////////// // DLG_GetUser dialog DLG_GetUser::DLG_GetUser(CWnd* pParent /*=NULL*/) : CDialog(DLG_GetUser::IDD, pParent) { //{{AFX_DATA_INIT(DLG_GetUser) // NOTE: the ClassWizard will add member initialization here //}}AFX_DATA_INIT memset( m_szTitle , 0 , sizeof(m_szTitle) ); m_bInit=false; m_bShowCount = false; } void DLG_GetUser::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(DLG_GetUser) DDX_Control(pDX, IDC_GETUSER_COUNT, m_S_Count); DDX_Control(pDX, IDC_GETUSER_PROCESS, m_Process); //}}AFX_DATA_MAP } BEGIN_MESSAGE_MAP(DLG_GetUser, CDialog) //{{AFX_MSG_MAP(DLG_GetUser) //}}AFX_MSG_MAP ON_WM_TIMER() END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // DLG_GetUser message handlers void DLG_GetUser::OnCancel() { CDialog::OnCancel(); } BOOL DLG_GetUser::OnInitDialog() { CDialog::OnInitDialog(); m_Process.SetRange( 0 , 100 ); SetWindowText(_T("正在取服务器资料...")); if ( _tcslen(m_szTitle)>0) SetWindowText( m_szTitle ); if ( m_bShowCount ) { m_S_Count.ShowWindow( SW_SHOW ); } m_bInit = true; return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE } void DLG_GetUser::SetProcess(long lAll, long lCur) { try { if ( !IsWindow(m_hWnd) ) return ; m_Process.SetRange( 0 , (short)lAll ); m_Process.SetPos( lCur ); if ( m_bShowCount ) { CString str; str.Format( _T("%d/%d") , lCur , lAll ); if ( lAll == 99999999 ) str.Format( _T("%d/?") , lCur ); m_S_Count.SetWindowText(str); } if ( lCur >= lAll ) { SetTimer(1,10,NULL); //EndDialog(IDOK); //CDialog::OnOK(); } } catch(...) { } } void DLG_GetUser::SetProcessTitle(TCHAR *pMsg) { _tcscpy(m_szTitle , pMsg ); // if ( _tcslen(m_szTitle)>0 && m_bInit) // SetWindowText( m_szTitle ); } void DLG_GetUser::SetShowCount(BOOL bShow) { m_bShowCount = true; } void DLG_GetUser::OnTimer(UINT_PTR nIDEvent) { CDialog::OnTimer(nIDEvent); if ( nIDEvent==1 ) { KillTimer(nIDEvent); EndDialog(IDOK); } }