Click here to Skip to main content
15,881,248 members
Articles / Desktop Programming / MFC

EasyFtp 1.3.2 (for Applications)

Rate me:
Please Sign up or sign in to vote.
4.91/5 (28 votes)
21 Mar 2004CC (ASA 2.5)7 min read 149.5K   3.1K   119  
A 'drop-in' FTP solution for applications providing a full GUI, extended commandline options and no resource files. Use standalone or compiled into your own app.
// maskedit.cpp : implementation file
//

#include "stdafx.h"
#include "maskedit.h"

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

/////////////////////////////////////////////////////////////////////////////
// CMaskEdit

CMaskEdit::CMaskEdit(LPCTSTR szMask, BOOL bExclude) : m_sMask(szMask), m_bExclude(bExclude)
{
}

CMaskEdit::~CMaskEdit()
{
}


BEGIN_MESSAGE_MAP(CMaskEdit, CEdit)
	//{{AFX_MSG_MAP(CMaskEdit)
	ON_WM_CHAR()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CMaskEdit message handlers

void CMaskEdit::OnChar(UINT nChar, UINT nRepCnt, UINT nFlags) 
{
	switch (nChar)
	{
	case VK_BACK:
		break;

	case 'c':
	case 'C':
	case 'v':
	case 'V':
	case 'x':
	case 'X':
		if (GetAsyncKeyState(VK_CONTROL) & 0x8000)
			break;

	default:
		{
		if (m_bExclude && m_sMask.Find(nChar) != -1)
			return;

		else if (!m_bExclude && m_sMask.Find(nChar) == -1)
			return;
		}
		break;
	}


	CEdit::OnChar(nChar, nRepCnt, nFlags);
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Creative Commons Attribution-ShareAlike 2.5 License


Written By
Software Developer Maptek
Australia Australia
.dan.g. is a naturalised Australian and has been developing commercial windows software since 1998.

Comments and Discussions