123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899 |
- #include "stdafx.h"
- #include "LYFZIPReceiveApp.h"
- #include "LYFZIPReceive.h"
- #include "AddIPDlg.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- CAddIPDlg::CAddIPDlg(CWnd* pParent )
- : CDialog(CAddIPDlg::IDD, pParent)
- {
-
- m_strIPaddress = _T("");
-
- }
- void CAddIPDlg::DoDataExchange(CDataExchange* pDX)
- {
- CDialog::DoDataExchange(pDX);
-
- DDX_Text(pDX, IDC_IPADDRESS, m_strIPaddress);
-
- }
- BEGIN_MESSAGE_MAP(CAddIPDlg, CDialog)
-
-
- END_MESSAGE_MAP()
- BOOL CAddIPDlg::OnInitDialog()
- {
- CDialog::OnInitDialog();
-
- if (!m_strTitle.IsEmpty())
- SetWindowText(m_strTitle);
-
- ((CEdit *)GetDlgItem(IDC_IPADDRESS))->SetLimitText(15);
- CenterWindow();
- return TRUE;
- }
-
- BOOL CAddIPDlg::PreTranslateMessage(MSG* pMsg)
- {
- if (pMsg->message == WM_CHAR && pMsg->hwnd == ::GetDlgItem(m_hWnd, IDC_IPADDRESS))
- {
- TCHAR nChar = (TCHAR)pMsg->wParam;
- if ((IsCharAlphaNumeric(nChar) && !IsCharAlpha(nChar)) ||
- nChar == '.' || nChar == '\b' || nChar == '\t' || nChar == '*')
- {
- return CDialog::PreTranslateMessage(pMsg);
- }
- else
- {
-
- return TRUE;
- }
- }
- return CDialog::PreTranslateMessage(pMsg);
- }
|