// DlgKeyJogLogin.cpp : ±¸Çö ÆÄÀÏÀÔ´Ï´Ù. // #include "stdafx.h" #include "ReviewSystem.h" #include "DlgKeyJogLogin.h" #include "afxdialogex.h" // DlgKeyJogLogin ´ëÈ­ »óÀÚÀÔ´Ï´Ù. IMPLEMENT_DYNAMIC(CDlgKeyJogLogin, CDialogEx) CDlgKeyJogLogin::CDlgKeyJogLogin(CWnd* pParent /*=NULL*/) : CDialog(CDlgKeyJogLogin::IDD, pParent) { Password = _T("dnfghkxhd"); m_bLoginSuccess = FALSE; NowTime = NULL; } CDlgKeyJogLogin::~CDlgKeyJogLogin() { } void CDlgKeyJogLogin::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); DDX_Control(pDX, IDC_LOGIN_PW, m_ctrlLogin_PW); DDX_Control(pDX, IDC_LOGIN_STATUS, m_staticLoginState); } BEGIN_MESSAGE_MAP(CDlgKeyJogLogin, CDialog) END_MESSAGE_MAP() // DlgKeyJogLogin ¸Þ½ÃÁö 󸮱âÀÔ´Ï´Ù. BOOL CDlgKeyJogLogin::PreTranslateMessage(MSG* pMsg) { if(pMsg->message == WM_KEYDOWN && pMsg->hwnd == GetDlgItem(IDC_LOGIN_PW)->m_hWnd && pMsg->wParam == VK_RETURN) { CString tempPW; m_ctrlLogin_PW.GetWindowText(tempPW); if(Password == tempPW) { m_bLoginSuccess = TRUE; m_staticLoginState.SetWindowText(_T("[N/A]")); this->CloseWindow(); return CDialog::PreTranslateMessage(pMsg); } else { m_ctrlLogin_PW.SetWindowText(_T("")); m_staticLoginState.SetWindowText(_T("Password Fail!!!")); } } ::TranslateMessage(pMsg); ::DispatchMessage(pMsg); return TRUE; } BOOL CDlgKeyJogLogin::GetLoginSuccess() { return m_bLoginSuccess; } BOOL CDlgKeyJogLogin::OnInitDialog() { CDialog::OnInitDialog(); CString strFont = _T("MS Sans Serif"); m_staticLoginState.SetFontStatic(strFont, 17, RGB(0,0,0), FS_CENTER); m_staticLoginState.SetBackground(RGB(240,240,240)); m_staticLoginState.SetWindowText(_T("[N/A]")); NowTime = CTime::GetCurrentTime(); //Password.Format(_T("%02d%02d"), NowTime.GetHour(), NowTime.GetMinute()); m_bLoginSuccess = FALSE; return TRUE; // return TRUE unless you set the focus to a control // ¿¹¿Ü: OCX ¼Ó¼º ÆäÀÌÁö´Â FALSE¸¦ ¹ÝÈ¯ÇØ¾ß ÇÕ´Ï´Ù. }