SDC C-Project CF Review 프로그램
LYW
2022-07-05 63439977901d54a01924ed76290931aeddbce66c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
// 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¸¦ ¹ÝÈ¯ÇØ¾ß ÇÕ´Ï´Ù.
}