Click here to Skip to main content
11,639,508 members (69,129 online)
Click here to Skip to main content
Add your own
alternative version

Enhanced Focus Edit Control with Input Filtering

, 3 Oct 2000 CPOL 119.3K 2.3K 35
An edit control that provides strong visual feedback when it has the input focus, and allows filtering of input and/or displayed characters.
focusedit.zip
focuseditdemo.zip
FocusEditDemo
Release
FocusEditDemo.exe
Res
FocusEditDemo.ico
FocusEditDemo.dsw
FocusEditDemo.clw
FocusEditDemo.dsp
// FocusEditDemo.cpp : Defines the class behaviors for the application.
//

#include "stdafx.h"
#include "FocusEditDemo.h"
#include	"FocusEditCtrl.h"
#include "FocusEditDemoDlg.h"

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

/////////////////////////////////////////////////////////////////////////////
// CFocusEditDemoApp

BEGIN_MESSAGE_MAP(CFocusEditDemoApp, CWinApp)
	//{{AFX_MSG_MAP(CFocusEditDemoApp)
		// NOTE - the ClassWizard will add and remove mapping macros here.
		//    DO NOT EDIT what you see in these blocks of generated code!
	//}}AFX_MSG
	ON_COMMAND(ID_HELP, CWinApp::OnHelp)
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CFocusEditDemoApp construction

CFocusEditDemoApp::CFocusEditDemoApp()
{
	// TODO: add construction code here,
	// Place all significant initialization in InitInstance
}

/////////////////////////////////////////////////////////////////////////////
// The one and only CFocusEditDemoApp object

CFocusEditDemoApp theApp;

/////////////////////////////////////////////////////////////////////////////
// CFocusEditDemoApp initialization

BOOL CFocusEditDemoApp::InitInstance()
{
	// Standard initialization
	// If you are not using these features and wish to reduce the size
	//  of your final executable, you should remove from the following
	//  the specific initialization routines you do not need.

#ifdef _AFXDLL
	Enable3dControls();			// Call this when using MFC in a shared DLL
#else
	Enable3dControlsStatic();	// Call this when linking to MFC statically
#endif

	CFocusEditDemoDlg dlg;
	m_pMainWnd = &dlg;
	int nResponse = dlg.DoModal();
	if (nResponse == IDOK)
	{
		// TODO: Place code here to handle when the dialog is
		//  dismissed with OK
	}
	else if (nResponse == IDCANCEL)
	{
		// TODO: Place code here to handle when the dialog is
		//  dismissed with Cancel
	}

	// Since the dialog has been closed, return FALSE so that we exit the
	//  application, rather than start the application's message pump.
	return FALSE;
}

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 Code Project Open License (CPOL)

Share

About the Author

James R. Twine
President JRTwine Software, LLC
United States United States
Programming since the age of 10, started professionally at the age of 17. Currently involved in both Client and Server side development on Win32 platforms for MC/HA/FT financial applications. Development experience with Win32, Win16, Linux and other flavors of Unix.

Extensive multithreaded development experience on Windows platforms using the Win32 SDK, and MFC.

Experience with HA/FT n-tiered Client/Server systems as well as GUI apps of varying complexity. Some experience with Game developement.

Having learned that the stuff you can barely get away with doing Client-side apps just does not cut it in the real "Server World", I am amazed how many 'professionals' cannot tell the difference between "works" and "correct" or try to (mis)use VB and/or MFC on server-side development projects, never considering that just because it RUNS, does not mean it runs WELL.

Lastly, I am also a collector of arcade games, and can perform repairs, conversions, etc. Search for my name, you will find me on lots of arcade-related documents and sites.

Sites of interest(?):
http://www.jrtwine.com
http://www.jrtwine.com/jtwine
http://www.signingtime.com
http://www.deletefxpfiles.com
http://www.checkfavorites.com
http://www.coinop.org

You may also be interested in...

| Advertise | Privacy | Terms of Use | Mobile
Web03 | 2.8.150728.1 | Last Updated 4 Oct 2000
Article Copyright 2000 by James R. Twine
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid