www.gusucode.com > VC++远程视频监控系统源代码-源码程序 > VC++远程视频监控系统源代码-源码程序/code/发送端/发送端/InputPwd.cpp

    // InputPwd.cpp : implementation file
//

#include "stdafx.h"
#include "play.h"
#include "InputPwd.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CInputPwd dialog


CInputPwd::CInputPwd(CWnd* pParent /*=NULL*/)
	: CDialog(CInputPwd::IDD, pParent)
{
	//{{AFX_DATA_INIT(CInputPwd)
	m_Passwd = _T("");
	//}}AFX_DATA_INIT
	m_count=0;
}


void CInputPwd::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CInputPwd)
	DDX_Text(pDX, IDC_INPUTPWD, m_Passwd);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CInputPwd, CDialog)
	//{{AFX_MSG_MAP(CInputPwd)
	ON_BN_CLICKED(IDC_MODIFYPWD, OnModifypwd)
	ON_BN_CLICKED(IDC_SURE, OnSure)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CInputPwd message handlers



void CInputPwd::OnModifypwd() 
{
	// TODO: Add your control notification handler code here
	CDialog::OnCancel();
	m_Modify=TRUE;
}

BOOL CInputPwd::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	// TODO: Add extra initialization here
	CWnd* pWnd=GetDlgItem(IDC_INPUTPWD);
    pWnd->SetFocus();
	return FALSE;  
}




void CInputPwd::OnSure() 
{
	// TODO: Add your control notification handler code here
	m_count++;
	UpdateData(TRUE);		
	if((strcmp(m_Passwd,dw_Passwd))!=0 &&m_count<2)
	{
		MessageBox("密码不对,请再输入一遍");
		CWnd* pWnd=GetDlgItem(IDC_INPUTPWD);
		pWnd->SetWindowText("");
		pWnd->SetFocus();
		
	}
	if((strcmp(m_Passwd,dw_Passwd))!=0&&m_count==2)
	{
		fail=TRUE;
		CDialog::OnCancel();
	}
	if((strcmp(m_Passwd,dw_Passwd))==0)
		CDialog::OnCancel();
}



void CInputPwd::OnCancel() 
{
	// TODO: Add extra cleanup here
	fail=TRUE;
	CDialog::OnCancel();
}