#pragma once #include "afxwin.h" // this class inheritance is as follows // CObject->CCmdTarget->CWin->CEdit->CTrapKeyEdit //to use: //1. create a dialog witha CDialog object compatible class //2. create a CEdit type text edit box on the dialog page //3. add a control variable for the edit box //4. rename the control variable class type to this class class CTrapKeyEdit : public CEdit { public: CTrapKeyEdit(void); //~CTrapKeyEdit(void); virtual ~CTrapKeyEdit(); void DispatchEventEN_CHANGE(); bool isEnterKey; bool isLButton; //bool isNumber; bool m_bFocusFlag; //bool m_b; protected: afx_msg UINT OnGetDlgCode(); afx_msg void OnKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags); afx_msg void OnLButtonUp(UINT nFlags, CPoint point); afx_msg void OnKillfocus(); DECLARE_MESSAGE_MAP() };