Click here to Skip to main content
15,893,790 members
Articles / Desktop Programming / MFC

Building a Dynamic UI using a CWnd Free Pool

Rate me:
Please Sign up or sign in to vote.
4.84/5 (38 votes)
6 Jan 2007CPOL12 min read 324.8K   3.2K   141  
Classes for building MFC-based user interfaces dynamically, with a focus on minimizing resource usage.
// Filename: EditEx.h
// 27-May-2006 nschan Initial revision.

#ifndef EDIT_EX_INCLUDED
#define EDIT_EX_INCLUDED

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

// EN_CHANGE = 0x300, is defined in winuser.h.
const int EN_ENTER_KEY = 0x310;

// CEditEx class.
// This is simply an edit box that supports enter key events.
class CEditEx : public CEdit
{
public:
    // Constructor / destructor.
    CEditEx();
    virtual ~CEditEx();
    
    // ClassWizard generated virtual function overrides.
    //{{AFX_VIRTUAL(CEditEx)
    virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
    //}}AFX_VIRTUAL
    
protected:
    // Generated message map functions.
    //{{AFX_MSG(CEditEx)
    afx_msg void OnKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags);
    //}}AFX_MSG
    DECLARE_MESSAGE_MAP()
};

#endif // EDIT_EX_INCLUDED

// END

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)


Written By
Web Developer
Canada Canada
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions