⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 consetdlg.cpp

📁 MDF监控源码2
💻 CPP
字号:
// ConSetDlg.cpp : implementation file
//

#include "stdafx.h"
#include "MDF.h"
#include "ConSetDlg.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CConSetDlg dialog


//##ModelId=465286A4030F
CConSetDlg::CConSetDlg(CWnd* pParent /*=NULL*/)
	: CDialog(CConSetDlg::IDD, pParent)
{
	//{{AFX_DATA_INIT(CConSetDlg)
		// NOTE: the ClassWizard will add member initialization here
	//}}AFX_DATA_INIT
}


//##ModelId=465286A4033C
void CConSetDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CConSetDlg)
	DDX_Control(pDX, IDC_IPWEB, m_ctrlWEBIp);
	DDX_Control(pDX, IDC_IPDB, m_ctrlDBIp);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CConSetDlg, CDialog)
	//{{AFX_MSG_MAP(CConSetDlg)
	ON_BN_CLICKED(IDC_LOCK, OnLock)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CConSetDlg message handlers

//##ModelId=465286A4033F
BOOL CConSetDlg::OnInitDialog() 
{
	CDialog::OnInitDialog();
	// TODO: Add extra initialization here
	((CButton*)GetDlgItem(IDC_LOCK))->SetCheck(1) ;
	SetDlgItemText(IDC_IPWEB,m_strWebIp) ;
	SetDlgItemText(IDC_IPDB,m_strDBIp) ;
	GetDlgItem(IDC_IPWEB)->EnableWindow(FALSE) ;
	GetDlgItem(IDC_IPDB)->EnableWindow(FALSE) ;
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

//##ModelId=465286A4034B
void CConSetDlg::OnLock() 
{
	BYTE  f[4];
	memset(f,0,sizeof(f)) ;
	// TODO: Add your control notification handler code here
	if( ((CButton*)GetDlgItem(IDC_LOCK))->GetCheck() == 1 )
	{
		m_ctrlDBIp.GetAddress(f[0],f[1],f[2],f[3]) ;
		m_strDBIp.Format("%d.%d.%d.%d",f[0],f[1],f[2],f[3]) ;
		m_ctrlWEBIp.GetAddress(f[0],f[1],f[2],f[3]) ;
		m_strWebIp.Format("%d.%d.%d.%d",f[0],f[1],f[2],f[3]) ;
		GetDlgItem(IDC_IPWEB)->EnableWindow(FALSE) ;
		GetDlgItem(IDC_IPDB)->EnableWindow(FALSE) ;
	}
	else
	{
		GetDlgItem(IDC_IPWEB)->EnableWindow(TRUE) ;
		GetDlgItem(IDC_IPDB)->EnableWindow(TRUE) ;
	}
}

//##ModelId=465286A4032C
BOOL CConSetDlg::PreTranslateMessage(MSG* pMsg) 
{
	// TODO: Add your specialized code here and/or call the base class
	if( pMsg->message == WM_KEYDOWN && pMsg->wParam == VK_RETURN )
	{
		((CButton*)GetDlgItem(IDC_LOCK))->SetCheck(1) ;
		OnLock() ;
		return TRUE ;
	}	
	return CDialog::PreTranslateMessage(pMsg);
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -