-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCpasswd.cpp
More file actions
93 lines (69 loc) · 1.38 KB
/
Cpasswd.cpp
File metadata and controls
93 lines (69 loc) · 1.38 KB
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
// Cpasswd.cpp : 实现文件
//
#include "stdafx.h"
#include "Run.h"
#include "Cpasswd.h"
#include "afxdialogex.h"
// Cpasswd 对话框
IMPLEMENT_DYNAMIC(Cpasswd, CDialogEx)
Cpasswd::Cpasswd(CWnd* pParent /*=NULL*/)
: CDialogEx(IDD_PASSWD, pParent)
, m_edit(_T(""))
{
}
Cpasswd::~Cpasswd()
{
}
void Cpasswd::DoDataExchange(CDataExchange* pDX)
{
CDialogEx::DoDataExchange(pDX);
DDX_Text(pDX, IDC_EDIT1, m_edit);
}
BEGIN_MESSAGE_MAP(Cpasswd, CDialogEx)
ON_BN_CLICKED(IDC_BUTTON1, &Cpasswd::OnBnClickedButton1)
ON_BN_CLICKED(IDC_BUTTON2, &Cpasswd::OnBnClickedButton2)
END_MESSAGE_MAP()
// Cpasswd 消息处理程序
void Cpasswd::OnBnClickedButton1()
{
// TODO: 在此添加控件通知处理程序代码
UpdateData(TRUE);
if (m_edit == "413")
{
Cpasswd::OnOK();
}
else
{
MessageBox(L"密码错误");
}
}
void Cpasswd::OnBnClickedButton2()
{
// TODO: 在此添加控件通知处理程序代码
exit(0);
}
//void Cpasswd::OnOK()
//{
// // TODO: 在此添加专用代码和/或调用基类
//
// CDialogEx::OnOK();
//}
BOOL Cpasswd::PreTranslateMessage(MSG* pMsg)
{
// TODO: 在此添加专用代码和/或调用基类
if (pMsg->message == WM_KEYDOWN&&pMsg->wParam == VK_ESCAPE)
{
return TRUE;
}
if (pMsg->message == WM_KEYDOWN && pMsg->wParam == VK_RETURN)
{
this->OnBnClickedButton1();
return TRUE;
}
return CDialogEx::PreTranslateMessage(pMsg);
}
void Cpasswd::OnCancel()
{
// TODO: 在此添加专用代码和/或调用基类
exit(0);
}