?? adminpassworddlg.cpp
字號:
// AdminPasswordDlg.cpp : implementation file
//
#include "stdafx.h"
#include "resource.h"
#include "AdminPasswordDlg.h"
#include "MainFrm.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CAdminPasswordDlg dialog
CAdminPasswordDlg::CAdminPasswordDlg(CWnd* pParent /*=NULL*/)
: CDialog(CAdminPasswordDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CAdminPasswordDlg)
m_strPass = _T("");
m_strRePass = _T("");
//}}AFX_DATA_INIT
}
void CAdminPasswordDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CAdminPasswordDlg)
DDX_Text(pDX, IDC_EDIT_PASSWORD, m_strPass);
DDX_Text(pDX, IDC_EDIT_REPASSWORD, m_strRePass);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CAdminPasswordDlg, CDialog)
//{{AFX_MSG_MAP(CAdminPasswordDlg)
ON_BN_CLICKED(IDC_BUTTON_CONFIRM, OnButtonConfirm)
ON_BN_CLICKED(IDC_BUTTON_CANCEL, OnButtonCancel)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CAdminPasswordDlg message handlers
BOOL CAdminPasswordDlg::OnInitDialog()
{
//非全屏顯示對話框
SHINITDLGINFO shidi;
HWND hDlg = m_hWnd;
shidi.dwMask = SHIDIM_FLAGS;
shidi.dwFlags = SHIDIF_SIPDOWN;
shidi.hDlg = hDlg;
SHInitDialog(&shidi);
CenterWindow();
// TODO: Add extra initialization here
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CAdminPasswordDlg::OnButtonConfirm()
{
// TODO: Add your control notification handler code here
UpdateData(TRUE);
if (m_strPass != m_strRePass)
{
AfxMessageBox(L"兩次密碼不一致,請確認后重新輸入", MB_OK | MB_ICONEXCLAMATION);
return;
}
if (m_strPass.Compare(L"admin") != 0)
{
AfxMessageBox(L"密碼錯誤,請確認后重新輸入", MB_OK | MB_ICONEXCLAMATION);
return;
}
OnCancel();
::PostMessage(AfxGetMainWnd()->m_hWnd,WM_USER_COMMAND, CMainFrame.RDAConfig, 0);
}
void CAdminPasswordDlg::OnButtonCancel()
{
// TODO: Add your control notification handler code here
OnCancel();
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -