⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 anime.cpp

📁 The project demonstrates many Windows common controls, including the extensive use of image lists. T
💻 CPP
字号:
// anime.cpp : implementation file
//

#include "stdafx.h"
#include "DooDads.h"
#include "anime.h"

#ifdef _DEBUG
#undef THIS_FILE
static char BASED_CODE THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CAnimeDialog dialog


CAnimeDialog::CAnimeDialog(CWnd* pParent /*=NULL*/)
	: CDialog(CAnimeDialog::IDD, pParent)
{
	//{{AFX_DATA_INIT(CAnimeDialog)
		// NOTE: the ClassWizard will add member initialization here
	//}}AFX_DATA_INIT
}


void CAnimeDialog::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CAnimeDialog)
		// NOTE: the ClassWizard will add DDX and DDV calls here
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CAnimeDialog, CDialog)
	//{{AFX_MSG_MAP(CAnimeDialog)
	ON_BN_CLICKED(IDC_PLAY, OnPlay)
	ON_BN_CLICKED(IDC_BROWSE, OnBrowse)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()


/////////////////////////////////////////////////////////////////////////////
// CAnimeDialog message handlers

void CAnimeDialog::OnPlay() 
{
	CAnimateCtrl* pControl;
	pControl = (CAnimateCtrl*) GetDlgItem(IDC_ANIMATION);
	ASSERT(pControl != NULL);

	CString strName;
	GetDlgItem(IDC_FILENAME)->GetWindowText(strName);

	if (!pControl->Open(strName))
		MessageBox(_T("Could not open file, or file had unacceptable format."));
	else
		if (pControl->Play(0, (UINT) -1, 1))
			MessageBox(_T("Could not play file."));	
}

void CAnimeDialog::OnBrowse() 
{
	CString strName;
	GetDlgItem(IDC_FILENAME)->GetWindowText(strName);
	static TCHAR szFilter[] = _T("AVI Files (*.avi) | *.avi | All Files (*.*) | *.* ||");

	CFileDialog fileDlg(TRUE, _T(".AVI"), strName,
		OFN_HIDEREADONLY, szFilter, this);

	if (fileDlg.DoModal() == IDOK)
	{
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -