// PassDlg.cpp : implementation file // #include "stdafx.h" #include "AnnDemo.h" #include "PassDlg.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif ///////////////////////////////////////////////////////////////////////////// // CPasswordDlg dialog CPasswordDlg::CPasswordDlg(CWnd* pParent /*=NULL*/) : CDialog(CPasswordDlg::IDD, pParent) { //{{AFX_DATA_INIT(CPasswordDlg) m_Password = _T(""); //}}AFX_DATA_INIT } void CPasswordDlg::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(CPasswordDlg) DDX_Text(pDX, IDC_PASSWORD, m_Password); DDV_MaxChars(pDX, m_Password, 20); //}}AFX_DATA_MAP } BEGIN_MESSAGE_MAP(CPasswordDlg, CDialog) //{{AFX_MSG_MAP(CPasswordDlg) ON_EN_CHANGE(IDC_PASSWORD, OnChangePassword) //}}AFX_MSG_MAP END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // CPasswordDlg message handlers void CPasswordDlg::OnChangePassword() { // TODO: If this is a RICHEDIT control, the control will not // send this notification unless you override the CDialog::OnInitDialog() // function to send the EM_SETEVENTMASK message to the control // with the ENM_CHANGE flag ORed into the lParam mask. // TODO: Add your control notification handler code here CString cstrTmp; GetDlgItemText(IDC_PASSWORD, cstrTmp); GetDlgItem(IDOK)->EnableWindow(cstrTmp.GetLength()); }