📄 vc12aview.cpp
字号:
// vc12aView.cpp : implementation of the CVc12aView class
//
#include "stdafx.h"
#include "vc12a.h"
#include "vc12aDoc.h"
#include "vc12aView.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CVc12aView
IMPLEMENT_DYNCREATE(CVc12aView, CView)
BEGIN_MESSAGE_MAP(CVc12aView, CView)
//{{AFX_MSG_MAP(CVc12aView)
ON_COMMAND(ID_FILE_OPEN, OnFileOpen)
//}}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()
/////////////////////////////////////////////////////////////////////////////
// CVc12aView construction/destruction
CVc12aView::CVc12aView()
{
// TODO: add construction code here
m_hMCIWnd = NULL;
}
CVc12aView::~CVc12aView()
{
}
BOOL CVc12aView::PreCreateWindow(CREATESTRUCT& cs)
{
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
return CView::PreCreateWindow(cs);
}
/////////////////////////////////////////////////////////////////////////////
// CVc12aView drawing
void CVc12aView::OnDraw(CDC* pDC)
{
CVc12aDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
// TODO: add draw code for native data here
}
/////////////////////////////////////////////////////////////////////////////
// CVc12aView printing
BOOL CVc12aView::OnPreparePrinting(CPrintInfo* pInfo)
{
// default preparation
return DoPreparePrinting(pInfo);
}
void CVc12aView::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add extra initialization before printing
}
void CVc12aView::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add cleanup after printing
}
/////////////////////////////////////////////////////////////////////////////
// CVc12aView diagnostics
#ifdef _DEBUG
void CVc12aView::AssertValid() const
{
CView::AssertValid();
}
void CVc12aView::Dump(CDumpContext& dc) const
{
CView::Dump(dc);
}
CVc12aDoc* CVc12aView::GetDocument() // non-debug version is inline
{
ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CVc12aDoc)));
return (CVc12aDoc*)m_pDocument;
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CVc12aView message handlers
void CVc12aView::OnFileOpen()
{
// TODO: Add your command handler code here
CString OpenFileStr;
CString lpszFilter ;
lpszFilter ="波形音频文件(*.wav)|*.wav|MIDI音频文件(*.mid)|*.mid|视频文件(*.avi)|*.avi|Activemovie(*.aif)|*.aif|All Files(*.*)|*.*||";
CFileDialog m_dlg(TRUE,NULL,NULL,OFN_HIDEREADONLY
|OFN_OVERWRITEPROMPT,lpszFilter );
if(m_dlg.DoModal()==IDOK)
{
OpenFileStr=m_dlg.GetPathName();
if(m_hMCIWnd!=NULL)
MCIWndDestroy(m_hMCIWnd);
m_hMCIWnd=MCIWndCreate(m_hWnd,
AfxGetInstanceHandle(),MCIWNDF_NOOPEN,OpenFileStr);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -