// sView.cpp : implementation of the CSView class // #include "stdafx.h" #include "s.h" #include "sDoc.h" #include "sView.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif ///////////////////////////////////////////////////////////////////////////// // CSView IMPLEMENT_DYNCREATE(CSView, CHtmlView) BEGIN_MESSAGE_MAP(CSView, CHtmlView) //{{AFX_MSG_MAP(CSView) ON_WM_KEYDOWN() //}}AFX_MSG_MAP // Standard printing commands ON_COMMAND(ID_FILE_PRINT, CHtmlView::OnFilePrint) END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // CSView construction/destruction CSView::CSView() { // TODO: add construction code here } CSView::~CSView() { } BOOL CSView::PreCreateWindow(CREATESTRUCT& cs) { // TODO: Modify the Window class or styles here by modifying // the CREATESTRUCT cs return CHtmlView::PreCreateWindow(cs); } ///////////////////////////////////////////////////////////////////////////// // CSView drawing void CSView::OnDraw(CDC* pDC) { CSDoc* pDoc = GetDocument(); ASSERT_VALID(pDoc); // TODO: add draw code for native data here } void CSView::OnInitialUpdate() { CHtmlView::OnInitialUpdate(); // TODO: This code navigates to a popular spot on the web. // change the code to go where you'd like. Navigate2(_T("http://www.microsoft.com/visualc/"),NULL,NULL); } ///////////////////////////////////////////////////////////////////////////// // CSView printing ///////////////////////////////////////////////////////////////////////////// // CSView diagnostics #ifdef _DEBUG void CSView::AssertValid() const { CHtmlView::AssertValid(); } void CSView::Dump(CDumpContext& dc) const { CHtmlView::Dump(dc); } CSDoc* CSView::GetDocument() // non-debug version is inline { ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CSDoc))); return (CSDoc*)m_pDocument; } #endif //_DEBUG ///////////////////////////////////////////////////////////////////////////// // CSView message handlers void CSView::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags) { // TODO: Add your message handler code here and/or call default MessageBox("OnKeyDown"); CHtmlView::OnKeyDown(nChar, nRepCnt, nFlags); }
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionBOOL CMainFrame::PreTranslateMessage(MSG* pMsg) { if (pMsg->message==WM_CHAR) AfxMessageBox ("Pretranslate Char"); else if (pMsg->message==WM_SETFOCUS) AfxMessageBox ("Pretranslate Setocuzs"); else if (pMsg->message==WM_KILLFOCUS) AfxMessageBox ("Pretranslate Killocuzs"); return CFrameWnd::PreTranslateMessage(pMsg); }