Handling Keyboard Events
Handling Keyboard Events
#if !
defined(AFX_KEYBRDEVENTSVIEW_H__CE1E8293_A3A6_46BE_B973_330
80B034966__INCLUDED_)
#define
AFX_KEYBRDEVENTSVIEW_H__CE1E8293_A3A6_46BE_B973_33080B034
966__INCLUDED_
// Attributes
public:
CKeybrdEventsDoc* GetDocument();
int i,x;
char str[20],nChar;
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CKeybrdEventsView)
public:
virtual void OnDraw(CDC* pDC); // overridden to draw this view
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
protected:
virtual BOOL OnPreparePrinting(CPrintInfo* pInfo);
virtual void OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo);
virtual void OnEndPrinting(CDC* pDC, CPrintInfo* pInfo);
//}}AFX_VIRTUAL
// Implementation
public:
virtual ~CKeybrdEventsView();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
protected:
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the
previous line.
#endif // !
defined(AFX_KEYBRDEVENTSVIEW_H__CE1E8293_A3A6_46BE_B973_330
80B034966__INCLUDED_)
#include "stdafx.h"
#include "KeybrdEvents.h"
#include "KeybrdEventsDoc.h"
#include "KeybrdEventsView.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
// CKeybrdEventsView
IMPLEMENT_DYNCREATE(CKeybrdEventsView, CView)
BEGIN_MESSAGE_MAP(CKeybrdEventsView, CView)
//{{AFX_MSG_MAP(CKeybrdEventsView)
ON_WM_KEYDOWN()
//}}AFX_MSG_MAP
// Standard printing commands
ON_COMMAND(ID_FILE_PRINT, CView::OnFilePrint)
ON_COMMAND(ID_FILE_PRINT_DIRECT, CView::OnFilePrint)
ON_COMMAND(ID_FILE_PRINT_PREVIEW,
CView::OnFilePrintPreview)
END_MESSAGE_MAP()
// CKeybrdEventsView construction/destruction
CKeybrdEventsView::CKeybrdEventsView()
{
// TODO: add construction code here
x=100;
i=0;
}
CKeybrdEventsView::~CKeybrdEventsView()
{
}
return CView::PreCreateWindow(cs);
}
// CKeybrdEventsView drawing
// CKeybrdEventsView diagnostics
#ifdef _DEBUG
void CKeybrdEventsView::AssertValid() const
{
CView::AssertValid();
}
OUTPUT