Repository navigation
Expand file tree
/
Copy pathDlgUnLock.cpp
More file actions
93 lines (74 loc) · 1.45 KB
/
Copy pathDlgUnLock.cpp
File metadata and controls
93 lines (74 loc) · 1.45 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
#include "stdafx.h"
#include "xTrader.h"
#include "DlgUnLock.h"
IMPLEMENT_DYNAMIC(DlgUnLock, CDialog)
DlgUnLock::DlgUnLock(CWnd* pParent /*=NULL*/)
: CDialog(IDD_UNLOCK, pParent)
{
m_szPwd = _T("");
}
DlgUnLock::~DlgUnLock()
{
}
void DlgUnLock::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
DDX_Text(pDX, IDC_UNLOCKPWD, m_szPwd);
}
BEGIN_MESSAGE_MAP(DlgUnLock, CDialog)
ON_WM_DESTROY()
ON_EN_CHANGE(IDC_UNLOCKPWD, OnEnChgPwd)
ON_BN_CLICKED(ID_UNLOCKOK, OnUnLockOK)
ON_BN_CLICKED(IDC_ULQUIT, OnClkQuit)
END_MESSAGE_MAP()
BOOL DlgUnLock::OnInitDialog()
{
CDialog::OnInitDialog();
SetWindowPos(&wndTopMost,0,0,0,0,SWP_NOMOVE|SWP_NOSIZE);
EnableClose(this,FALSE);
GetDlgItem(IDC_UNLOCKPWD)->SetFocus();
return FALSE;
}
void DlgUnLock::OnDestroy()
{
CDialog::OnDestroy();
delete this;
}
void DlgUnLock::OnOK()
{
CDialog::OnOK();
DestroyWindow();
}
void DlgUnLock::OnCancel()
{
CDialog::OnCancel();
DestroyWindow();
}
void DlgUnLock::OnEnChgPwd()
{
UpdateData();
}
void DlgUnLock::OnUnLockOK()
{
TThostFtdcPasswordType sPwd;
uni2ansi(CP_ACP,(LPTSTR)(LPCTSTR)m_szPwd,sPwd);
if (!strcmp(g_s.m_sPwd,sPwd))
{
CXTraderDlg* p = g_Dlg;
p->m_bLocked = false;
p->ShowWindow(TRUE);
p->SetIdleTm();
OnOK();
}
else
{
m_szPwd.Empty();
UpdateData(FALSE);
SetDlgItemText(IDC_STAULMSG,LoadStr(IDS_UNLPWDERR));
GetDlgItem(IDC_UNLOCKPWD)->SetFocus();
}
}
void DlgUnLock::OnClkQuit()
{
g_Dlg->PostMessage(WM_QUIT);
}