103 lines
2.2 KiB
C++
103 lines
2.2 KiB
C++
|
// DLG_Passwd.cpp : implementation file
|
|||
|
//
|
|||
|
|
|||
|
#include "stdafx.h"
|
|||
|
#include "smsmanager.h"
|
|||
|
#include "DLG_Passwd.h"
|
|||
|
|
|||
|
#ifdef _DEBUG
|
|||
|
#define new DEBUG_NEW
|
|||
|
#undef THIS_FILE
|
|||
|
static char THIS_FILE[] = __FILE__;
|
|||
|
#endif
|
|||
|
|
|||
|
/////////////////////////////////////////////////////////////////////////////
|
|||
|
// DLG_Passwd dialog
|
|||
|
|
|||
|
|
|||
|
DLG_Passwd::DLG_Passwd(CWnd* pParent /*=NULL*/)
|
|||
|
: CDialog(DLG_Passwd::IDD, pParent)
|
|||
|
{
|
|||
|
//{{AFX_DATA_INIT(DLG_Passwd)
|
|||
|
m_strNew = _T("");
|
|||
|
m_strNewRe = _T("");
|
|||
|
m_strUser = _T("");
|
|||
|
m_strYmm = _T("");
|
|||
|
//}}AFX_DATA_INIT
|
|||
|
|
|||
|
memset( &m_Setup , 0 , sizeof(m_Setup) );
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
void DLG_Passwd::DoDataExchange(CDataExchange* pDX)
|
|||
|
{
|
|||
|
CDialog::DoDataExchange(pDX);
|
|||
|
//{{AFX_DATA_MAP(DLG_Passwd)
|
|||
|
DDX_Text(pDX, IDC_PASSWD_NEW, m_strNew);
|
|||
|
DDV_MaxChars(pDX, m_strNew, 16);
|
|||
|
DDX_Text(pDX, IDC_PASSWD_NEWRE, m_strNewRe);
|
|||
|
DDV_MaxChars(pDX, m_strNewRe, 16);
|
|||
|
DDX_Text(pDX, IDC_PASSWD_USER, m_strUser);
|
|||
|
DDV_MaxChars(pDX, m_strUser, 16);
|
|||
|
DDX_Text(pDX, IDC_PASSWD_YMM, m_strYmm);
|
|||
|
DDV_MaxChars(pDX, m_strYmm, 16);
|
|||
|
//}}AFX_DATA_MAP
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
BEGIN_MESSAGE_MAP(DLG_Passwd, CDialog)
|
|||
|
//{{AFX_MSG_MAP(DLG_Passwd)
|
|||
|
//}}AFX_MSG_MAP
|
|||
|
END_MESSAGE_MAP()
|
|||
|
|
|||
|
/////////////////////////////////////////////////////////////////////////////
|
|||
|
// DLG_Passwd message handlers
|
|||
|
|
|||
|
void DLG_Passwd::OnOK()
|
|||
|
{
|
|||
|
UpdateData(true);
|
|||
|
if ( m_strYmm != CString(m_Setup.szPasswd) )
|
|||
|
{
|
|||
|
MessageBox( _T("ԭ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>벻<EFBFBD><EFBFBD>ȷ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!") , _T("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>") , MB_ICONWARNING );
|
|||
|
GetDlgItem(IDC_PASSWD_YMM)->SetFocus();
|
|||
|
return ;
|
|||
|
}
|
|||
|
if ( m_strNew.GetLength() < 8 )
|
|||
|
{
|
|||
|
MessageBox( _T("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>8λ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!") , _T("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>") , MB_ICONWARNING );
|
|||
|
GetDlgItem(IDC_PASSWD_NEW)->SetFocus();
|
|||
|
return ;
|
|||
|
}
|
|||
|
if ( m_strNew != m_strNewRe )
|
|||
|
{
|
|||
|
MessageBox( _T("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>벻<EFBFBD><EFBFBD>ͬ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!") , _T("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>") , MB_ICONWARNING );
|
|||
|
GetDlgItem(IDC_PASSWD_NEW)->SetFocus();
|
|||
|
return ;
|
|||
|
}
|
|||
|
|
|||
|
_tcscpy( m_Setup.szPasswd , m_strNew );
|
|||
|
|
|||
|
CDialog::OnOK();
|
|||
|
}
|
|||
|
|
|||
|
void DLG_Passwd::SetParam(SM_Setup setup)
|
|||
|
{
|
|||
|
m_Setup = setup;
|
|||
|
}
|
|||
|
|
|||
|
SM_Setup DLG_Passwd::GetParam()
|
|||
|
{
|
|||
|
return m_Setup;
|
|||
|
}
|
|||
|
|
|||
|
BOOL DLG_Passwd::OnInitDialog()
|
|||
|
{
|
|||
|
CDialog::OnInitDialog();
|
|||
|
|
|||
|
m_strUser = m_Setup.szUser;
|
|||
|
UpdateData( false );
|
|||
|
|
|||
|
return TRUE; // return TRUE unless you set the focus to a control
|
|||
|
// EXCEPTION: OCX Property Pages should return FALSE
|
|||
|
}
|