【VC开源代码栏目提醒】:网学会员在VC开源代码频道为大家收集整理了FingerIdentifyDlg.cpp提供大家参考,希望对大家有所帮助!
// FingerIdentifyDlg.cpp : implementation file
//
#include "stdafx.h"
#include "FingerIdentify.h"
#include "FingerIdentifyDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CAboutDlg dialog used for App About
typedef struct _Personinfo{
char id[4];
char name[10];
char dept[20];
char finger[100];
bool isuser;
}PersonInfo;
PersonInfo personinfo[999];
class CAboutDlg : public CDialog
{
public:
CAboutDlg();
// Dialog Data
//{{AFX_DATA(CAboutDlg)
enum { IDD = IDD_ABOUTBOX };
//}}AFX_DATA
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CAboutDlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
//{{AFX_MSG(CAboutDlg)
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
{
//{{AFX_DATA_INIT(CAboutDlg)
//}}AFX_DATA_INIT
}
void CAboutDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CAboutDlg)
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
//{{AFX_MSG_MAP(CAboutDlg)
// No message handlers
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CFingerIdentifyDlg dialog
CFingerIdentifyDlg::CFingerIdentifyDlg(CWnd* pParent /*=NULL*/)
: CDialog(CFingerIdentifyDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CFingerIdentifyDlg)
//}}AFX_DATA_INIT
// Note that LoadIcon does not require a subsequent DestroyIcon in Win32
m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
}
void CFingerIdentifyDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CFingerIdentifyDlg)
DDX_Control(pDX, IDC_STATIC1, m_image);
DDX_Control(pDX, IDC_EDIT3, m_dept);
DDX_Control(pDX, IDC_EDIT2, m_name);
DDX_Control(pDX, IDC_EDIT1, m_id);
DDX_Control(pDX, IDC_LIST1, m_list);
DDX_Control(pDX, IDC_ZKFPENGX1, m_zkeng);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CFingerIdentifyDlg, CDialog)
//{{AFX_MSG_MAP(CFingerIdentifyDlg)
ON_WM_SYSCOMMAND()
ON_WM_PAINT()
ON_WM_QUERYDRAGICON()
ON_BN_CLICKED(IDC_BUTTON6, OnInitfacility)
ON_BN_CLICKED(IDC_BUTTON5, OnClosefacility)
ON_BN_CLICKED(IDC_BUTTON4, OnClose)
ON_NOTIFY(LVN_ITEMCHANGING, IDC_LIST1, OnItemchangingList1)
ON_BN_CLICKED(IDC_BUTTON2, OnAdd)
ON_WM_DESTROY()
ON_BN_CLICKED(IDC_BUTTON1, OnRegister)
ON_BN_CLICKED(IDC_BUTTON3, OnButton3)
ON_BN_CLICKED(IDC_BUTTON7, OnButton7)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CFingerIdentifyDlg message handlers
BOOL CFingerIdentifyDlg::OnInitDialog()
{
CDialog::OnInitDialog();
// Add "About..." menu item to system menu.
// IDM_ABOUTBOX must be in the system command range.
ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX);
ASSERT(IDM_ABOUTBOX < 0xF000);
CMenu* pSysMenu = GetSystemMenu(FALSE);
if (pSysMenu != NULL)
{
CString strAboutMenu;
strAboutMenu.LoadString(IDS_ABOUTBOX);
if (!strAboutMenu.IsEmpty())
{
pSysMenu->AppendMenu(MF_SEPARATOR);
pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu);
}
}
// Set the icon for this dialog. The framework does this automatically
// when the application's main window is not a dialog
SetIcon(m_hIcon, TRUE); // Set big icon
SetIcon(m_hIcon, FALSE); // Set small icon
// TODO: Add extra initialization here
m_list.InsertColumn(0,"员工编号");
m_list.SetColumnWidth(0,100);
m_list.InsertColumn(1,"员工");
m_list.SetColumnWidth(1,100);
m_list.InsertColumn(2,"员工部门");
m_list.SetColumnWidth(2,100);
personinfo[123].isuser = true;
strcpy(personinfo[123].id,"123");
strcpy(personinfo[123].name,"张三");
strcpy(personinfo[123].dept,"C#");
personinfo[001].isuser = true;
strcpy(personinfo[001].id,"001");
strcpy(personinfo[001].name,"李四");
strcpy(personinfo[001].dept,"
软件");
UpdateList();
m_list.SetExtendedStyle(LVS_EX_FULLROWSELECT |
LVS_EX_GRIDLINES | LVS_EX_FLATSB);
m_id.SetLimitText(3);
IdentifyType = 0;
return TRUE; // r